Created
May 1, 2015 15:38
-
-
Save samdmarshall/fbb80b1b43d34549a4be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// taken from https://opensource.apple.com/source/CF/CF-855.17/CFDate.c | |
CFAbsoluteTime CFAbsoluteTimeGetCurrent(void) { | |
CFAbsoluteTime ret; | |
struct timeval tv; | |
gettimeofday(&tv, NULL); // http://linux.die.net/man/2/gettimeofday | |
ret = (CFTimeInterval)tv.tv_sec - kCFAbsoluteTimeIntervalSince1970; | |
ret += (1.0E-6 * (CFTimeInterval)tv.tv_usec); | |
return ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment