Minor refactor
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
#include "timeutil.h"
|
||||
|
||||
using std::chrono::high_resolution_clock;
|
||||
using std::chrono::duration_cast;
|
||||
using std::chrono::microseconds;
|
||||
|
||||
timeutil::Timer::Timer() {
|
||||
start = high_resolution_clock::now();
|
||||
}
|
||||
int64_t timeutil::Timer::stop() {
|
||||
return duration_cast<microseconds>(high_resolution_clock::now()-start).count();
|
||||
}
|
||||
|
||||
float timeutil::time_value(float hour, float minute, float second) {
|
||||
return (hour + (minute + second / 60.0f) / 60.0f) / 24.0f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user