Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
include
osl
game_playing
csaStopwatch.h
Go to the documentation of this file.
1
/* csaStopwatch.h
2
*/
3
#ifndef GAME_PLAYING_CSASTOPWATCH_H
4
#define GAME_PLAYING_CSASTOPWATCH_H
5
#include "
osl/misc/milliSeconds.h
"
6
7
namespace
osl
8
{
9
namespace
game_playing
10
{
11
class
CsaStopwatch
12
{
13
MilliSeconds
start
;
14
public
:
15
CsaStopwatch
() :
start
(MilliSeconds::now())
16
{
17
}
18
int
read
() {
19
double
elapsed =
start
.elapsedSeconds();
20
int
ret = (int)floor(elapsed);
21
return
std::max
(1, ret);
22
}
23
};
24
}
// namespace game_playing
25
}
// namespace osl
26
27
28
#endif
/* GAME_PLAYING_CSASTOPWATCH_H */
29
// ;;; Local Variables:
30
// ;;; mode:c++
31
// ;;; c-basic-offset:2
32
// ;;; End:
Generated on Sun Jul 21 2013 13:37:23 by
1.8.4