mirror of
https://github.com/monero-project/monero.git
synced 2025-06-21 04:04:11 -04:00
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.
This commit is contained in:
parent
ab594cfee9
commit
bda8c5983b
2 changed files with 17 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue