Timer: Added static ::now method for timestamps

This commit is contained in:
Paul Beckingham
2015-09-12 14:02:13 -04:00
parent f42de556fa
commit ed58263c16
2 changed files with 10 additions and 0 deletions

View File

@@ -112,3 +112,11 @@ void Timer::subtract (unsigned long value)
}
////////////////////////////////////////////////////////////////////////////////
unsigned long Timer::now ()
{
struct timeval now;
gettimeofday (&now, NULL);
return now.tv_sec * 1000000 + now.tv_usec;
}
////////////////////////////////////////////////////////////////////////////////