2020-08-29 20:48:32 +02:00
|
|
|
#ifndef CATCH_TIMER_HPP_INCLUDED
|
|
|
|
|
#define CATCH_TIMER_HPP_INCLUDED
|
2013-08-07 18:56:35 +01:00
|
|
|
|
2017-08-17 16:13:28 +02:00
|
|
|
#include <cstdint>
|
2013-08-07 18:56:35 +01:00
|
|
|
|
2017-04-25 08:43:14 +01:00
|
|
|
namespace Catch {
|
2013-08-07 18:56:35 +01:00
|
|
|
|
2017-08-04 12:22:16 +01:00
|
|
|
auto getCurrentNanosecondsSinceEpoch() -> uint64_t;
|
2017-08-04 21:31:28 +01:00
|
|
|
auto getEstimatedClockResolution() -> uint64_t;
|
2017-08-04 12:16:05 +01:00
|
|
|
|
|
|
|
|
class Timer {
|
2017-08-04 12:22:16 +01:00
|
|
|
uint64_t m_nanoseconds = 0;
|
2017-08-04 12:16:05 +01:00
|
|
|
public:
|
2017-08-04 13:53:47 +01:00
|
|
|
void start();
|
2017-12-08 15:57:36 +00:00
|
|
|
auto getElapsedNanoseconds() const -> uint64_t;
|
|
|
|
|
auto getElapsedMicroseconds() const -> uint64_t;
|
2017-08-04 13:53:47 +01:00
|
|
|
auto getElapsedMilliseconds() const -> unsigned int;
|
|
|
|
|
auto getElapsedSeconds() const -> double;
|
2013-08-07 18:56:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Catch
|
|
|
|
|
|
2020-08-29 20:48:32 +02:00
|
|
|
#endif // CATCH_TIMER_HPP_INCLUDED
|