summaryrefslogtreecommitdiff
path: root/protocols/Tox/libtox/src/toxcore/mono_time.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-16 21:13:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-01-16 21:13:32 +0300
commit2ad44a4cd4f811d6c7da5c8e9e31acf6e0152c79 (patch)
tree0585db93be035ea25d807b788ccfc4c7217c7587 /protocols/Tox/libtox/src/toxcore/mono_time.h
parent8fc53a06b7a8163d61c06fbde88ffea904222bdd (diff)
fixes #1767 (Update toxcore to 0.2.9)
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/mono_time.h')
-rw-r--r--protocols/Tox/libtox/src/toxcore/mono_time.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/mono_time.h b/protocols/Tox/libtox/src/toxcore/mono_time.h
index 503548f222..aa244baeb0 100644
--- a/protocols/Tox/libtox/src/toxcore/mono_time.h
+++ b/protocols/Tox/libtox/src/toxcore/mono_time.h
@@ -45,11 +45,26 @@ typedef struct Mono_Time Mono_Time;
Mono_Time *mono_time_new(void);
void mono_time_free(Mono_Time *mono_time);
+/**
+ * Update mono_time; subsequent calls to mono_time_get or mono_time_is_timeout
+ * will use the time at the call to mono_time_update.
+ */
void mono_time_update(Mono_Time *mono_time);
+
+/**
+ * Return unix time since epoch in seconds.
+ */
uint64_t mono_time_get(const Mono_Time *mono_time);
+
+/**
+ * Return true iff timestamp is at least timeout seconds in the past.
+ */
bool mono_time_is_timeout(const Mono_Time *mono_time, uint64_t timestamp, uint64_t timeout);
-/* return current monotonic time in milliseconds (ms). */
+/**
+ * Return current monotonic time in milliseconds (ms). The starting point is
+ * unspecified.
+ */
uint64_t current_time_monotonic(Mono_Time *mono_time);
typedef uint64_t mono_time_current_time_cb(Mono_Time *mono_time, void *user_data);