aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/util.h')
-rw-r--r--common/rfb/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/rfb/util.h b/common/rfb/util.h
index e9114c3d..3ca92f9d 100644
--- a/common/rfb/util.h
+++ b/common/rfb/util.h
@@ -95,9 +95,17 @@ namespace rfb {
return (secs < 0 || secs > (INT_MAX/1000) ? INT_MAX : secs * 1000);
}
+ // Returns time elapsed between two moments in milliseconds.
+ unsigned msBetween(const struct timeval *first,
+ const struct timeval *second);
+
// Returns time elapsed since given moment in milliseconds.
unsigned msSince(const struct timeval *then);
+ // Returns true if first happened before seconds
+ bool isBefore(const struct timeval *first,
+ const struct timeval *second);
+
size_t siPrefix(long long value, const char *unit,
char *buffer, size_t maxlen, int precision=6);
size_t iecPrefix(long long value, const char *unit,