empiredan commented on code in PR #1351:
URL:
https://github.com/apache/incubator-pegasus/pull/1351#discussion_r1115277561
##########
src/utils/time_utils.h:
##########
@@ -126,5 +130,29 @@ inline int64_t hh_mm_today_to_unix_sec(string_view
hhmm_of_day)
return get_unix_sec_today_midnight() + sec_of_day;
}
+class chronograph
+{
+public:
+ chronograph() : chronograph(dsn_now_ns()) {}
+ chronograph(uint64_t start_time_ns) : _start_time_ns(start_time_ns) {}
+ ~chronograph() = default;
+
+ inline void reset_start_time() { _start_time_ns = dsn_now_ns(); }
+
+ template <typename T, typename = typename
std::enable_if<std::is_integral<T>::value>::type>
Review Comment:
OK, since internally we use `dsn_now_ns()` to save timestamp, I'll change
the type to `uint64_t`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]