More accurate alternative to millisecs()

BlitzMax Forums/BlitzMax Programming/More accurate alternative to millisecs()

I was going to request it, but in the meantime came up with this (only works on OS X):

I found that millisecs wasn't accurate enough for me, so I present the following.

Add this bit to your Blitz source:

Import "GetTime.c"

Extern
	Function getTime:Double()
End Extern



And place this in a text file named "GetTime.c" in the same folder as your Blitz project:
#include <Carbon/Carbon.h>

double getTime()
{
double t;

t=(double)GetCurrentEventTime();
return t;
}


This returns the time in seconds since System startup. I have no idea how to do this on Windows, but I'm sure someone else does.