diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-05-24 08:19:44 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-06-19 07:25:35 -0400 |
commit | faab4aaf2fa1153c6d76efc8113fa01b06943ece (patch) | |
tree | 001b0d0f9948037b9fa4ebac3ccb8269d21a4a04 /src | |
parent | 62948caf4446246ec2b525e95705bb07b6a8f2bd (diff) | |
download | bitcoin-faab4aaf2fa1153c6d76efc8113fa01b06943ece.tar.xz |
util: Add count_microseconds helper
Diffstat (limited to 'src')
-rw-r--r-- | src/util/time.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/util/time.h b/src/util/time.h index b00c25f67c..af934e423b 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -15,10 +15,15 @@ void UninterruptibleSleep(const std::chrono::microseconds& n); /** * Helper to count the seconds of a duration. * - * All durations should be using std::chrono and calling this should generally be avoided in code. Though, it is still - * preferred to an inline t.count() to protect against a reliance on the exact type of t. + * All durations should be using std::chrono and calling this should generally + * be avoided in code. Though, it is still preferred to an inline t.count() to + * protect against a reliance on the exact type of t. + * + * This helper is used to convert durations before passing them over an + * interface that doesn't support std::chrono (e.g. RPC, debug log, or the GUI) */ inline int64_t count_seconds(std::chrono::seconds t) { return t.count(); } +inline int64_t count_microseconds(std::chrono::microseconds t) { return t.count(); } /** * DEPRECATED |