From 7afa74b53110c0258c7fa9ae5aa8e7dde7534b4d Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 31 Aug 2025 16:49:59 +0200 Subject: feat! BenchKit breaking changes. why: - Made it expandable to other traits and platforms. - You can provide a `Traits` now to the `HWChrono`. Signed-off-by: Amlal El Mahrouss --- dev/misc/BenchKit/Chronometer.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 dev/misc/BenchKit/Chronometer.h (limited to 'dev/misc/BenchKit/Chronometer.h') diff --git a/dev/misc/BenchKit/Chronometer.h b/dev/misc/BenchKit/Chronometer.h new file mode 100644 index 00000000..3a82a94e --- /dev/null +++ b/dev/misc/BenchKit/Chronometer.h @@ -0,0 +1,40 @@ +/* ------------------------------------------- + +Copyright (C) 2025, Amlal El Mahrouss, all rights reserved. + +------------------------------------------- */ + +#ifndef BENCHKIT_CHRONO_H +#define BENCHKIT_CHRONO_H + +#include +#include + +/// @author Amlal El Mahrouss +/// @brief BenchKit Chrono contract. + +#define BENCHKIT_INTERFACE : public ::Kernel::ChronoInterface + +namespace Kernel { +class ChronoInterface; + +/// @brief a Chronometer interface used for benchmarking. +class ChronoInterface { + public: + ChronoInterface() = default; + virtual ~ChronoInterface() = default; + + NE_COPY_DEFAULT(ChronoInterface) + + virtual Void Start() = 0; + virtual Void Stop() = 0; + virtual Void Reset() = 0; + virtual UInt64 GetElapsedTime() const = 0; +}; +} // namespace Kernel + +namespace BenchKit { +using namespace Kernel; +} + +#endif // BENCHKIT_CHRONO_H -- cgit v1.2.3