The code in Swift
...
var time:timeval?
gettimeofday(UnsafePointer<timeval>, UnsafePointer<()>) // this is the method expansion before filling in any data
...
The code in Objective C
...
struct timeval time;
gettimeofday(&time, NULL);
...
I have been trying to find more information on UnsafePointer and alternatives to passing NULL, but I may be barking up the wrong tree.
If anyone knows how to get the equivilant code working in Swift, that would be great. If there is a good explanation of what's going on with it that would be even better!
let now = NSDate()
is simpler... – TakeoverUIEvents
come with a.timestamp
which is sub-millisecond. I guess if you need the microseconds thentimval
gives that. – Takeover