aboutsummaryrefslogtreecommitdiff
path: root/src/util/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/time.h')
-rw-r--r--src/util/time.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/time.h b/src/util/time.h
index 2c0e3d83f6..03b75b5be5 100644
--- a/src/util/time.h
+++ b/src/util/time.h
@@ -27,6 +27,7 @@ void UninterruptibleSleep(const std::chrono::microseconds& n);
* 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_milliseconds(std::chrono::milliseconds t) { return t.count(); }
inline int64_t count_microseconds(std::chrono::microseconds t) { return t.count(); }
/**
@@ -64,4 +65,9 @@ int64_t ParseISO8601DateTime(const std::string& str);
*/
struct timeval MillisToTimeval(int64_t nTimeout);
+/**
+ * Convert milliseconds to a struct timeval for e.g. select.
+ */
+struct timeval MillisToTimeval(std::chrono::milliseconds ms);
+
#endif // BITCOIN_UTIL_TIME_H