Add helper to easily determine how much time has passed since some previous
event.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4783 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/util.h b/common/rfb/util.h
index 4124769..7d90a6b 100644
--- a/common/rfb/util.h
+++ b/common/rfb/util.h
@@ -30,6 +30,8 @@
#include <limits.h>
#include <string.h>
+struct timeval;
+
namespace rfb {
// -=- Class to handle cleanup of arrays of characters
@@ -85,6 +87,9 @@
inline int secsToMillis(int secs) {
return (secs < 0 || secs > (INT_MAX/1000) ? INT_MAX : secs * 1000);
}
+
+ // Returns time elapsed since given moment in milliseconds.
+ unsigned msSince(const struct timeval *then);
}
// Some platforms (e.g. Windows) include max() and min() macros in their