+# The number of milliseconds elapsed since January 1, 1970
+#
+# Returns `get_microtime / 1000`
+fun get_millitime: Int do return get_microtime / 1000
+
+# The number of microseconds elapsed since January 1, 1970
+#
+# Uses the Unix function `gettimeofday`.
+fun get_microtime: Int `{
+ struct timeval val;
+ gettimeofday(&val, NULL);
+ return val.tv_sec * 1000000 + val.tv_usec;
+`}
+