time: use floats for seconds
This commit is contained in:
parent
6eb2badaef
commit
803ec2cacc
6
time.cpp
6
time.cpp
@ -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);
|
||||
}
|
||||
|
4
time.hpp
4
time.hpp
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user