You are using timeIntervalSinceNow
on an object that represents a very very close value to "now". Since you print in float, the value is rounded down to lower precision and you get 0.
Are you sure you didn't mean timeIntervalSince1970
?
NSTimeInterval
is defined as a double
. If you need precision above float, try printing as double using %ld
. If you need even more precision, look into mach_absolute_time()
.