MLIB
Loading...
Searching...
No Matches
stopwatch.h
Go to the documentation of this file.
1/*
2 Copyright (c) Mircea Neacsu (2014-2025) Licensed under MIT License.
3 This file is part of MLIB project. See LICENSE file for full license terms.
4*/
5
7
8#pragma once
9
10#if __has_include("defs.h")
11#include "defs.h"
12#endif
13
14#ifndef _INC_WINDOWS
15#include <windows.h>
16#endif
17
18namespace mlib {
19
22{
23public:
24 stopwatch ();
25 void start ();
26 void stop ();
27 double msecLap ();
28 double msecEnd ();
29
30private:
31 static LARGE_INTEGER freq;
32 LARGE_INTEGER tbeg, tend;
33};
34
35} // namespace mlib
double msecLap()
Return number of milliseconds elapsed from start.
Definition stopwatch.cpp:41
double msecEnd()
Return total duration in milliseconds between start and stop.
Definition stopwatch.cpp:50
stopwatch()
Constructor.
Definition stopwatch.cpp:15
void start()
Start the stopwatch.
Definition stopwatch.cpp:24
void stop()
Stop the stopwatch.
Definition stopwatch.cpp:31