aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/threadnames.cpp2
-rw-r--r--src/util/time.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/util/threadnames.cpp b/src/util/threadnames.cpp
index b221b0c975..c25e9ed661 100644
--- a/src/util/threadnames.cpp
+++ b/src/util/threadnames.cpp
@@ -57,6 +57,6 @@ static void SetInternalName(std::string name) { }
void util::ThreadRename(std::string&& name)
{
- SetThreadName(("bitcoin-" + name).c_str());
+ SetThreadName(("b-" + name).c_str());
SetInternalName(std::move(name));
}
diff --git a/src/util/time.h b/src/util/time.h
index e4f9996777..c0470a2136 100644
--- a/src/util/time.h
+++ b/src/util/time.h
@@ -11,6 +11,14 @@
#include <chrono>
/**
+ * 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.
+ */
+inline int64_t count_seconds(std::chrono::seconds t) { return t.count(); }
+
+/**
* DEPRECATED
* Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)
*/