Nebula
Loading...
Searching...
No Matches
darwintimer.h
Go to the documentation of this file.
1#pragma once
2#ifndef DARWIN_DARWINTIMER_H
3#define DARWIN_DARWINTIMER_H
4//------------------------------------------------------------------------------
14#include "core/types.h"
15#include "timing/time.h"
16
17//------------------------------------------------------------------------------
18namespace Darwin
19{
21{
22public:
26 void Start();
28 void Stop();
30 void Reset();
32 bool Running() const;
34 Timing::Time GetTime() const;
36 uint GetTicks() const;
37
38private:
40 uint64_t InternalTime() const;
41
42 bool running;
43 uint64_t diffTime; // accumulated time when the timer was not running
44 uint64_t stopTime; // when was the timer last stopped?
45};
46
47} // namespace Darwin
48//------------------------------------------------------------------------------
49#endif
50
Darwin implementation of the Time::Timer class.
Definition darwintimer.h:21
Timing::Time GetTime() const
get current time in seconds
Definition darwintimer.cc:121
DarwinTimer()
constructor
Definition darwintimer.cc:18
uint64_t InternalTime() const
return internal time as 64 bit integer
Definition darwintimer.cc:95
bool Running() const
return true if currently running
Definition darwintimer.cc:85
uint64_t stopTime
Definition darwintimer.h:44
bool running
Definition darwintimer.h:42
void Reset()
reset the timer
Definition darwintimer.cc:65
uint64_t diffTime
Definition darwintimer.h:43
uint GetTicks() const
get current time in ticks
Definition darwintimer.cc:142
void Stop()
stop the timer
Definition darwintimer.cc:53
void Start()
start/continue the timer
Definition darwintimer.cc:33
Definition darwinsysteminfo.cc:10
double Time
the time datatype
Definition time.h:18
Typedefs for the Timing subsystem.
unsigned int uint
Definition types.h:31