#include <ddgclock.h>
Public Members | |||
ddgClock ( float init = 0.0) | |||
Create a clock and initialize its time. | |||
float | update (void) | ||
Returns elapsed in milli seconds time since last call. | |||
void | set (int t) | ||
Set the clock to some time in seconds. | |||
float | getSysTime (void) | ||
Get time in seconds. | |||
float | getElapsed (void) | ||
Get elapsed time in seconds. | |||
float | getFrameRate (void) | ||
Calculate a frame rate based on time since last call. | |||
float | getAvgFrameRate (void) | ||
Calculate an averaged frame rate. Across ddgFPSBUFSIZE frames. | |||
float | getSimTime (float *h = 0, float *m = 0, float *s = 0, float *r = 0) | ||
If r is given, r returns the number of partial seconds and s is rounded. | |||
void | start ( float t) | ||
Set the start time in sim seconds. | |||
void | simfactor ( float f ) | ||
Set the conversion factor for sys seconds to sim seconds.. | |||
float | getDayLight (void) | ||
Return the light intensity. 0 at night, 1 during day, inbetween at dusk and dawn. | |||
void | perf ( unsigned int tf ) | ||
Set perf on or off. | |||
bool | perfDump ( ddgStr *filename = NULL, char *s = NULL ) | ||
Write collected performance information to a logfile or standard out. Return true on error. | |||
Static Public Members | |||
void | timeStamp ( ddgStr *timestamp ) | ||
Generate a timestamp string. |