File tree Expand file tree Collapse file tree 3 files changed +95
-193
lines changed Expand file tree Collapse file tree 3 files changed +95
-193
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,5 @@ void BindTiming(py::module &m) {
43
43
.def (" get_elapsed_us" , &GetElapsedWrapper<std::chrono::microseconds>)
44
44
.def (" get_elapsed_ms" , &GetElapsedWrapper<std::chrono::milliseconds>)
45
45
.def (" get_elapsed_s" , &GetElapsedWrapper<std::chrono::seconds>)
46
- .def (" get_elapsed_string" , &Timer::GetElapsedString)
47
- .def (" __str__" , &Timer::GetElapsedString)
48
- .def (" __repr__" , [](const Timer &self) {
49
- return std::format (" <Timer(elapsed='{}') at {}>" , self.GetElapsedString (),
50
- static_cast <const void *>(&self));
51
- });
46
+ .def (" get_elapsed_str" , &Timer::GetElapsedString);
52
47
}
Original file line number Diff line number Diff line change @@ -109,6 +109,18 @@ class Timer {
109
109
*/
110
110
void Stop () noexcept { end_time_ = Clock::now (); }
111
111
112
+ /* *
113
+ * @brief Reset the timer to start a new measurement
114
+ *
115
+ * Resets the timer by capturing the current time as the new start point and clearing any
116
+ * previously recorded end time. This allows reusing the same timer instance for multiple
117
+ * measurements.
118
+ */
119
+ void Reset () noexcept {
120
+ start_time_ = Clock::now ();
121
+ end_time_ = TimePoint{};
122
+ }
123
+
112
124
/* *
113
125
* @brief Get the elapsed time in the specified duration type
114
126
*
@@ -166,18 +178,6 @@ class Timer {
166
178
*/
167
179
[[nodiscard]] auto GetElapsedString () const noexcept -> std::string;
168
180
169
- /* *
170
- * @brief Reset the timer to start a new measurement
171
- *
172
- * Resets the timer by capturing the current time as the new start point and clearing any
173
- * previously recorded end time. This allows reusing the same timer instance for multiple
174
- * measurements.
175
- */
176
- void Reset () noexcept {
177
- start_time_ = Clock::now ();
178
- end_time_ = TimePoint{};
179
- }
180
-
181
181
private:
182
182
TimePoint start_time_; // /< The time point when timing started
183
183
TimePoint end_time_; // /< The time point when timing stopped
You can’t perform that action at this time.
0 commit comments