Skip to content

Commit

Permalink
libcore|Time: Added conversion from TimeDelta to microseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 6, 2016
1 parent 9b2ce73 commit b1baae6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doomsday/sdk/libcore/include/de/data/time.h
Expand Up @@ -92,6 +92,8 @@ class DENG2_PUBLIC Time : public ISerializable
return *this;
}

duint64 asMicroSeconds() const;

/**
* Convert the delta to milliseconds.
*
Expand Down
5 changes: 5 additions & 0 deletions doomsday/sdk/libcore/src/data/time.cpp
Expand Up @@ -51,6 +51,11 @@ class SleeperThread : public QThread

} // namespace internal

duint64 Time::Delta::asMicroSeconds() const
{
return duint64(_seconds * 1000000);
}

duint64 TimeDelta::asMilliSeconds() const
{
return duint64(_seconds * 1000);
Expand Down

0 comments on commit b1baae6

Please sign in to comment.