add stopNs to timeutil::Timer

This commit is contained in:
MihailRis 2026-02-03 16:29:30 +03:00
parent 2475a7e8f5
commit 5d5a0e8932
2 changed files with 7 additions and 0 deletions

View file

@ -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) {
}