mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
Minor refactor
This commit is contained in:
parent
08701bca3c
commit
64295e2170
3 changed files with 30 additions and 14 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue