time: use floats for seconds

This commit is contained in:
Danny Robson 2015-01-19 19:11:41 +11:00
parent 6eb2badaef
commit 803ec2cacc
2 changed files with 6 additions and 6 deletions

View File

@ -84,16 +84,16 @@ delta_clock::delta_clock():
{ ; }
double
float
delta_clock::seconds (void) {
time.prev = time.curr;
time.curr = nanoseconds ();
return (time.curr - time.prev) / static_cast<double> (SECOND);
return (time.curr - time.prev) / static_cast<float> (SECOND);
}
// ----------------------------------------------------------------------------
util::period_query::period_query (double seconds) {
util::period_query::period_query (float seconds) {
m_time.start = nanoseconds ();
m_time.period = static_cast<uint64_t> (seconds * SECOND);
}

View File

@ -34,7 +34,7 @@ namespace util {
class delta_clock {
public:
delta_clock ();
double seconds (void);
float seconds (void);
protected:
struct {
@ -46,7 +46,7 @@ namespace util {
// ------------------------------------------------------------------------
class period_query {
public:
period_query (double seconds);
period_query (float seconds);
bool poll (void);