Go to the documentation of this file.00001
00002
00003 #ifndef GAME_PLAYING_CSASTOPWATCH_H
00004 #define GAME_PLAYING_CSASTOPWATCH_H
00005 #include "osl/misc/milliSeconds.h"
00006
00007 namespace osl
00008 {
00009 namespace game_playing
00010 {
00011 class CsaStopwatch
00012 {
00013 MilliSeconds start;
00014 public:
00015 CsaStopwatch() : start(MilliSeconds::now())
00016 {
00017 }
00018 int read() {
00019 double elapsed = start.elapsedSeconds();
00020 int ret = (int)floor(elapsed);
00021 return std::max(1, ret);
00022 }
00023 };
00024 }
00025 }
00026
00027
00028 #endif
00029
00030
00031
00032