diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/pass.cpp | 5 | ||||
-rw-r--r-- | src/support/timing.h | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index b2deb3b7b..284bb1642 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -140,12 +140,11 @@ void PassRunner::run() { WasmPrinter::printModule(wasm, moduleBefore); } // prepare to run - std::chrono::high_resolution_clock::time_point before; std::cerr << "[PassRunner] running pass: " << pass->name << "... "; for (size_t i = 0; i < padding - pass->name.size(); i++) { std::cerr << ' '; } - before = std::chrono::high_resolution_clock::now(); + auto before = std::chrono::steady_clock::now(); if (pass->isFunctionParallel()) { // function-parallel passes should get a new instance per function for (auto& func : wasm->functions) { @@ -154,7 +153,7 @@ void PassRunner::run() { } else { pass->run(this, wasm); } - auto after = std::chrono::high_resolution_clock::now(); + auto after = std::chrono::steady_clock::now(); std::chrono::duration<double> diff = after - before; std::cerr << diff.count() << " seconds." << std::endl; totalTime += diff; diff --git a/src/support/timing.h b/src/support/timing.h index e8b48ec5f..d60450442 100644 --- a/src/support/timing.h +++ b/src/support/timing.h @@ -27,18 +27,18 @@ namespace wasm { class Timer { std::string name; - std::chrono::high_resolution_clock::time_point startTime; + std::chrono::steady_clock::time_point startTime; double total = 0; public: Timer(std::string name) : name(name) {} void start() { - startTime = std::chrono::high_resolution_clock::now(); + startTime = std::chrono::steady_clock::now(); } void stop() { - total += std::chrono::duration<double>(std::chrono::high_resolution_clock::now() - startTime).count(); + total += std::chrono::duration<double>(std::chrono::steady_clock::now() - startTime).count(); } double getTotal() { |