aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/profile_tools.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-08-15 20:45:47 +0200
committerRiccardo Spagni <ric@spagni.net>2017-08-15 20:45:47 +0200
commit1cf4665d2abd9ec86e5cd09cc9262c36b89cc04b (patch)
treec90017e020bbd17ebe47fb594f944c2286fe0f0e /contrib/epee/include/profile_tools.h
parentMerge pull request #2233 (diff)
parentcore: speed up output index unique set calculation (diff)
downloadmonero-1cf4665d2abd9ec86e5cd09cc9262c36b89cc04b.tar.xz
Merge pull request #2237
5d4ef719 core: speed up output index unique set calculation (moneromooo-monero) 19d7f568 perf_timer: allow profiling more granular than millisecond (moneromooo-monero) bda8c598 epee: add nanosecond timer and pause/restart profiling macros (moneromooo-monero)
Diffstat (limited to 'contrib/epee/include/profile_tools.h')
-rw-r--r--contrib/epee/include/profile_tools.h7
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