+/*
+ Return the current unix timestamp as milliseconds since the epoch.
+ If time() returns 515300400, this function will add three didgets which
+ represent the milliseconds: 515300400123 (515300400.123).
+*/
+extern long long mstime( ) {
+ struct timespec now;
+ long long rv = 0;
+
+ if( clock_gettime( CLOCK_REALTIME, &now ) ) {
+ return rv;
+ }
+
+ rv = ((long long) now.tv_sec * 1000) + ( (long long) now.tv_nsec/1000000 );
+ return rv;
+}
+