diff options
author | Ruoxin Xu <ruoxin.xu@mongodb.com> | 2022-07-26 10:19:14 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-26 11:32:37 +0000 |
commit | e7d2be0dae29265e2a6efafd4753debf11b9e96f (patch) | |
tree | 394a15ee762d5eee6abad5d492e35330789c6dcf /src/mongo/db/exec/scoped_timer.cpp | |
parent | e922e94ad274ef6d712d3a454a6d8427a736f2f6 (diff) | |
download | mongo-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.cpp | 9 |
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 |