mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add stopNs to timeutil::Timer
This commit is contained in:
parent
2475a7e8f5
commit
5d5a0e8932
2 changed files with 7 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
using std::chrono::duration_cast;
|
||||
using std::chrono::high_resolution_clock;
|
||||
using std::chrono::microseconds;
|
||||
using std::chrono::nanoseconds;
|
||||
|
||||
timeutil::Timer::Timer() {
|
||||
start = high_resolution_clock::now();
|
||||
|
|
@ -14,6 +15,11 @@ int64_t timeutil::Timer::stop() {
|
|||
.count();
|
||||
}
|
||||
|
||||
int64_t timeutil::Timer::stopNs() {
|
||||
return duration_cast<nanoseconds>(high_resolution_clock::now() - start)
|
||||
.count();
|
||||
}
|
||||
|
||||
timeutil::ScopeLogTimer::ScopeLogTimer(long long id) : scopeid_(id) {
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue