time/delta_time: return nanoseconds objects rather than floats

This commit is contained in:
Danny Robson 2018-04-05 18:48:23 +10:00
parent 665c8aa49e
commit 3748b77500
2 changed files with 4 additions and 4 deletions

View File

@ -46,13 +46,13 @@ delta_clock::delta_clock ():
//-----------------------------------------------------------------------------
float
delta_clock::seconds (void)
std::chrono::nanoseconds
delta_clock::dt (void)
{
time.prev = time.curr;
time.curr = nanoseconds ();
return (time.curr - time.prev) / static_cast<float> (SECOND);
return std::chrono::nanoseconds (time.curr - time.prev);
}

View File

@ -46,7 +46,7 @@ namespace util {
class delta_clock {
public:
delta_clock ();
float seconds (void);
std::chrono::nanoseconds dt(void);
protected:
struct {