diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-19 23:22:55 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-20 21:55:01 +0000 |
commit | cf3b20dba22718b533eac6854cde86b6538958af (patch) | |
tree | 9a0e795cd74d2721140c48012f794298dfef7420 /searchlib/src/tests/attribute/benchmark/attributeupdater.h | |
parent | 64b7c822099d7cda921699e380c4d95608a1ab00 (diff) |
FastOS_Time -> std::chrono.
Diffstat (limited to 'searchlib/src/tests/attribute/benchmark/attributeupdater.h')
-rw-r--r-- | searchlib/src/tests/attribute/benchmark/attributeupdater.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/searchlib/src/tests/attribute/benchmark/attributeupdater.h b/searchlib/src/tests/attribute/benchmark/attributeupdater.h index 1dad2cb563d..c56c809457b 100644 --- a/searchlib/src/tests/attribute/benchmark/attributeupdater.h +++ b/searchlib/src/tests/attribute/benchmark/attributeupdater.h @@ -98,7 +98,7 @@ protected: std::vector<BT> _getBuffer; RandomGenerator & _rndGen; AttributeCommit _expected; - FastOS_Time _timer; + fastos::StopWatch _timer; AttributeUpdaterStatus _status; AttributeValidator _validator; @@ -267,7 +267,7 @@ template <typename Vector, typename T, typename BT> void AttributeUpdater<Vector, T, BT>::populate() { - _timer.SetNow(); + _timer.restart(); for (uint32_t doc = 0; doc < _attrPtr->getNumDocs(); ++doc) { updateValues(doc); if (doc % _commitFreq == (_commitFreq - 1)) { @@ -275,7 +275,7 @@ AttributeUpdater<Vector, T, BT>::populate() } } commit(); - _status._totalUpdateTime += _timer.MilliSecsToNow(); + _status._totalUpdateTime += _timer.elapsed().ms(); } @@ -283,7 +283,7 @@ template <typename Vector, typename T, typename BT> void AttributeUpdater<Vector, T, BT>::update(uint32_t numUpdates) { - _timer.SetNow(); + _timer.restart(); for (uint32_t i = 0; i < numUpdates; ++i) { uint32_t doc = getRandomDoc(); updateValues(doc); @@ -292,7 +292,7 @@ AttributeUpdater<Vector, T, BT>::update(uint32_t numUpdates) } } commit(); - _status._totalUpdateTime += _timer.MilliSecsToNow(); + _status._totalUpdateTime += _timer.elapsed().ms(); } @@ -300,7 +300,7 @@ template <typename Vector, typename T, typename BT> void AttributeUpdaterThread<Vector, T, BT>::doRun() { - this->_timer.SetNow(); + this->_timer.restart(); while(!_done) { uint32_t doc = this->getRandomDoc(); this->updateValues(doc); @@ -309,7 +309,7 @@ AttributeUpdaterThread<Vector, T, BT>::doRun() } } this->commit(); - this->_status._totalUpdateTime += this->_timer.MilliSecsToNow(); + this->_status._totalUpdateTime += this->_timer.elapsed().ms(); } |