| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsPrerequisitesUtil.h"
- namespace bs
- {
- /** @addtogroup General
- * @{
- */
- /** Timer class used for querying high precision timers. */
- class BS_UTILITY_EXPORT Timer
- {
- public:
- /** Construct the timer and start timing. */
- Timer();
- /** Reset the timer to zero. */
- void reset();
- /** Returns time in milliseconds since timer was initialized or last reset. */
- UINT64 getMilliseconds() const;
- /** Returns time in microseconds since timer was initialized or last reset. */
- UINT64 getMicroseconds() const;
- /**
- * Returns the time at which the timer was initialized, in milliseconds.
- *
- * @return Time in milliseconds.
- */
- UINT64 getStartMs() const;
- private:
- std::chrono::high_resolution_clock mHRClock;
- std::chrono::time_point<std::chrono::high_resolution_clock> mStartTime;
- };
- /** @} */
- }
|