Imagine++
Imagine
Common
src
Imagine
Common
Timer.h
1
// ===========================================================================
2
// Imagine++ Libraries
3
// Copyright (C) Imagine
4
// For detailed information: http://imagine.enpc.fr/software
5
// ===========================================================================
6
7
namespace
Imagine
{
10
11
15
class
Timer
{
16
private
:
17
double
_start;
18
static
double
time() {
19
#if _WIN32
20
return
double(std::clock())/CLOCKS_PER_SEC;
21
#else
22
struct
tms b;
23
times(&b);
24
return
double(b.tms_utime)/sysconf(_SC_CLK_TCK);
25
#endif
26
}
27
public
:
33
Timer
() {
34
reset
();
35
}
43
double
lap
()
const
{
44
return
Timer::time() - _start;
45
}
51
void
reset
() {
52
_start = Timer::time();
53
}
54
};
55
57
}
Imagine::Timer::Timer
Timer()
Constructor.
Definition:
Timer.h:33
Imagine::Timer
Timers.
Definition:
Timer.h:15
Imagine::Timer::lap
double lap() const
Lap.
Definition:
Timer.h:43
Imagine
Imagine++ namespace.
Definition:
Array.h:7
Imagine::Timer::reset
void reset()
Reset.
Definition:
Timer.h:51
Generated by
1.8.13