Skip to content

Commit

Permalink
libdeng2|Time: Added time delta since start of native process
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 25, 2014
1 parent 7d24d75 commit 6804dca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doomsday/libdeng2/include/de/data/time.h
Expand Up @@ -109,6 +109,12 @@ class DENG2_PUBLIC Time : public ISerializable
return Delta(milliseconds/1000.0);
}

/**
* Determines the amount of time passed since the beginning of the native
* process (i.e., since creation of the high performance timer).
*/
static Delta sinceStartOfProcess();

/**
* Blocks the thread.
*/
Expand Down
5 changes: 5 additions & 0 deletions doomsday/libdeng2/src/data/time.cpp
Expand Up @@ -71,6 +71,11 @@ ddouble TimeDelta::asDays() const
return asHours() / 24;
}

Time::Delta Time::Delta::sinceStartOfProcess()
{
return highPerfTimer.elapsed();
}

void TimeDelta::sleep() const
{
if(_seconds < 60)
Expand Down

0 comments on commit 6804dca

Please sign in to comment.