diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-08-01 14:03:18 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-08-01 14:03:18 +0100 |
commit | bda8c5983ba41274cca6144f4a1f29b23eaa44a7 (patch) | |
tree | 73272c9766c79e6760025a1a0f16f486cdb50dc8 /contrib/epee/include/profile_tools.h | |
parent | Merge pull request #2159 (diff) | |
download | monero-bda8c5983ba41274cca6144f4a1f29b23eaa44a7.tar.xz |
epee: add nanosecond timer and pause/restart profiling macros
Nanosecond timer precision won't work on Windows, but we don't
care since I'm using that just for profiling incremental code
paths, but a Windows coder is welcome to add it if there's a way.
Diffstat (limited to '')
-rw-r--r-- | contrib/epee/include/profile_tools.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/epee/include/profile_tools.h b/contrib/epee/include/profile_tools.h index d3b1e4db4..f285fe48b 100644 --- a/contrib/epee/include/profile_tools.h +++ b/contrib/epee/include/profile_tools.h @@ -57,8 +57,15 @@ namespace epee #define TIME_MEASURE_START(var_name) uint64_t var_name = epee::misc_utils::get_tick_count(); +#define TIME_MEASURE_PAUSE(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; +#define TIME_MEASURE_RESTART(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; #define TIME_MEASURE_FINISH(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; +#define TIME_MEASURE_NS_START(var_name) uint64_t var_name = epee::misc_utils::get_ns_count(); +#define TIME_MEASURE_NS_PAUSE(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; +#define TIME_MEASURE_NS_RESTART(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; +#define TIME_MEASURE_NS_FINISH(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; + namespace profile_tools { struct local_call_account |