From 72ed48fc6b2f822850f599130a90e3131aee8695 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Wed, 7 Feb 2024 14:02:29 +0800 Subject: [PATCH] some fix --- include/pocketpy/profiler.h | 4 ---- src/profiler.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/pocketpy/profiler.h b/include/pocketpy/profiler.h index e414924d..82c077ac 100644 --- a/include/pocketpy/profiler.h +++ b/include/pocketpy/profiler.h @@ -11,10 +11,6 @@ struct LineRecord{ i64 hits; clock_t time; - clock_t time_per_hit() const { - return time / hits; - } - LineRecord(int line, SourceData* src): line(line), src(src), hits(0), time(0) {} std::string_view line_content() const; diff --git a/src/profiler.cpp b/src/profiler.cpp index fd5fedff..b9780b02 100644 --- a/src/profiler.cpp +++ b/src/profiler.cpp @@ -73,7 +73,7 @@ Str LineProfiler::stats(){ ss << left_pad(std::to_string(line), 6); ss << left_pad(std::to_string(record.hits), 10); ss << left_pad(std::to_string(record.time), 13); - ss << left_pad(std::to_string(record.time_per_hit()), 9); + ss << left_pad(std::to_string(record.time / record.hits), 9); ss << left_pad(to_string_1f(record.time * (f64)100 / total_time), 9); ss << " " << record.line_content() << "\n"; }