Minor refactor

This commit is contained in:
MihailRis
2023-12-05 23:01:29 +03:00
parent 08701bca3c
commit 64295e2170
3 changed files with 30 additions and 14 deletions
+11
View File
@@ -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;
}