namespace PluggIt { class Clock { private long long base; private char str[20]; public Clock() { Reset(); } public void Reset() { base = direct_clock_get_micros(); } public float GetTime() { return (direct_clock_get_micros() - base) / 1000000.0f; } public const char *GetString() { float time = GetTime(); int seconds = (int) time; int minutes = seconds / 60; snprintf( str, sizeof(str), "%02d:%02d", minutes, seconds ); return str; } }; }