MLIB
Loading...
Searching...
No Matches
stopwatch.h
Go to the documentation of this file.
1
6#pragma once
7
8#if __has_include("defs.h")
9#include "defs.h"
10#endif
11
12#ifndef _INC_WINDOWS
13#include <windows.h>
14#endif
15
16namespace mlib {
17
20{
21public:
22 stopwatch ();
23 void start ();
24 void stop ();
25 double msecLap ();
26 double msecEnd ();
27
28private:
29 static LARGE_INTEGER freq;
30 LARGE_INTEGER tbeg, tend;
31};
32
33} // namespace mlib
Simple stopwatch timer (yet another one!)
Definition stopwatch.h:20
double msecLap()
Return number of milliseconds elapsed from start.
Definition stopwatch.cpp:42
double msecEnd()
Return total duration in milliseconds between start and stop.
Definition stopwatch.cpp:51
stopwatch()
Constructor.
Definition stopwatch.cpp:16
void start()
Start the stopwatch.
Definition stopwatch.cpp:25
void stop()
Stop the stopwatch.
Definition stopwatch.cpp:32