Beamlib
3.5.3
This is the Beam C++ class library.
Loading...
Searching...
No Matches
BTimer.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* BTimer.h Quantel Quentin BTimers
3
* T.Barnaby, BEAM Ltd, 3/2/04
4
* Copyright (c) 2022 All Right Reserved, Beam Ltd, https://www.beam.ltd.uk
5
* For license see LICENSE.txt at the root of the beamlib source tree.
6
*******************************************************************************
7
*/
8
#ifndef BTIMER_H
9
#define BTIMER_H
10
11
#include <
BMutex.h
>
12
14
class
BTimer
{
15
public
:
16
BTimer
();
17
~BTimer
();
18
19
void
start
();
20
void
stop
();
21
void
clear
();
22
double
getElapsedTime
();
23
24
// Overall operations
25
void
add
(
BTimer
& timer);
26
27
// Statistics
28
double
average
();
29
double
peak
();
30
private
:
31
static
double
getTime();
32
33
BMutex
olock;
34
unsigned
int
onum;
35
double
ostartTime;
36
double
oendTime;
37
double
oaverage;
38
double
opeak;
39
};
40
#endif
BMutex.h
BMutex
Mutex class. Note these are recursive Mutexes and so you need to make sure the number of unlocks equa...
Definition
BMutex.h:14
BTimer
Stopwatch style timer.
Definition
BTimer.h:14
BTimer::start
void start()
Start timer.
Definition
BTimer.cpp:49
BTimer::~BTimer
~BTimer()
Definition
BTimer.cpp:15
BTimer::add
void add(BTimer &timer)
Add two timers.
Definition
BTimer.cpp:26
BTimer::getElapsedTime
double getElapsedTime()
Returns the elapsed time from the last start.
Definition
BTimer.cpp:68
BTimer::average
double average()
Average time is duration between start() and stop() / number of stops.
Definition
BTimer.cpp:78
BTimer::stop
void stop()
Stop timer.
Definition
BTimer.cpp:56
BTimer::clear
void clear()
Clear timer.
Definition
BTimer.cpp:39
BTimer::peak
double peak()
Peak time.
Definition
BTimer.cpp:87
BTimer::BTimer
BTimer()
Definition
BTimer.cpp:11
Generated by
1.12.0