| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #pragma once
- #include "BsPrerequisitesUtil.h"
- namespace BansheeEngine
- {
- /**
- * @brief Timer class used for querying high precision timers.
- *
- * @note Not thread safe.
- */
- class BS_UTILITY_EXPORT Timer
- {
- public:
- /**
- * @brief Construct the timer and start timing.
- */
- Timer();
- ~Timer();
- /**
- * @brief Reset the timer to zero.
- */
- void reset();
- /**
- * @brief Returns time in milliseconds since timer was initialized or
- * last reset.
- */
- unsigned long getMilliseconds();
- /**
- * @brief Returns time in microseconds since timer was initialized or
- * last reset.
- */
- unsigned long getMicroseconds();
- /**
- * @brief Returns time in milliseconds since timer was initialized or
- * last reset. Only CPU timer measured.
- */
- unsigned long getMillisecondsCPU();
- /**
- * @brief Returns time in microseconds since timer was initialized or
- * last reset. Only CPU timer measured.
- */
- unsigned long getMicrosecondsCPU();
- /**
- * @brief Returns the time at which the timer was initialized, in milliseconds.
- *
- * @return Time in milliseconds.
- */
- unsigned long getStartMs() const;
- private:
- struct Data;
- Data* m;
- };
- }
|