summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/scoped_timer.cpp
diff options
context:
space:
mode:
authorRuoxin Xu <ruoxin.xu@mongodb.com>2022-07-26 10:19:14 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-26 11:32:37 +0000
commite7d2be0dae29265e2a6efafd4753debf11b9e96f (patch)
tree394a15ee762d5eee6abad5d492e35330789c6dcf /src/mongo/db/exec/scoped_timer.cpp
parente922e94ad274ef6d712d3a454a6d8427a736f2f6 (diff)
downloadmongo-e7d2be0dae29265e2a6efafd4753debf11b9e96f.tar.gz
SERVER-67101 Support microsecond precision in ScopedTimer
Diffstat (limited to 'src/mongo/db/exec/scoped_timer.cpp')
-rw-r--r--src/mongo/db/exec/scoped_timer.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mongo/db/exec/scoped_timer.cpp b/src/mongo/db/exec/scoped_timer.cpp
index f33c498a57a..d7cc6064a7e 100644
--- a/src/mongo/db/exec/scoped_timer.cpp
+++ b/src/mongo/db/exec/scoped_timer.cpp
@@ -30,16 +30,11 @@
#include "mongo/platform/basic.h"
#include "mongo/db/exec/scoped_timer.h"
-#include "mongo/util/clock_source.h"
namespace mongo {
-
-ScopedTimer::ScopedTimer(ClockSource* cs, long long* counter)
- : _clock(cs), _counter(counter), _start(cs->now()) {}
+ScopedTimer::ScopedTimer(Microseconds* counter, TickSource* ts) : _counter(counter), _timer(ts) {}
ScopedTimer::~ScopedTimer() {
- long long elapsed = durationCount<Milliseconds>(_clock->now() - _start);
- *_counter += elapsed;
+ *_counter += _timer.elapsed();
}
-
} // namespace mongo