mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 20:44:37 +03:00
Added asmjit_test_perf, which replaces asmjit_bench and provides much better performance overview
Removed asmjit_test_opcode (not needed anymore as we have asmjit_test_assembler and asmjit_test_perf)
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
#include <chrono>
|
||||
|
||||
#include "cmdline.h"
|
||||
#include "performancetimer.h"
|
||||
|
||||
#include "asmjit_test_compiler.h"
|
||||
|
||||
#if defined(ASMJIT_BUILD_X86) && ASMJIT_ARCH_X86
|
||||
@@ -54,27 +56,6 @@ void compiler_add_a64_tests(TestApp& app);
|
||||
|
||||
using namespace asmjit;
|
||||
|
||||
class PerformanceTimer {
|
||||
public:
|
||||
typedef std::chrono::high_resolution_clock::time_point TimePoint;
|
||||
|
||||
TimePoint _startTime {};
|
||||
TimePoint _endTime {};
|
||||
|
||||
inline void start() {
|
||||
_startTime = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
inline void stop() {
|
||||
_endTime = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
inline double duration() const {
|
||||
std::chrono::duration<double> elapsed = _endTime - _startTime;
|
||||
return elapsed.count() * 1000;
|
||||
}
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// [TestApp]
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user