NSDate *start = [NSDate date];
// do stuff...
NSTimeInterval timeInterval = [start timeIntervalSinceNow];
timeInterval
is the difference between start and now, in seconds, with sub-millisecond precision.
More Related Contents:
- How to check iOS version?
- How do I make an HTTP request in Swift?
- How do I URL encode a string
- didReceiveRemoteNotification not called, iOS 10
- Get Location Updates for iOS App Even when Suspended
- Why NSUserDefaults failed to save NSMutableDictionary in iOS?
- Detecting Color of iPhone/iPad/iPod touch?
- Best way to sort an NSArray of NSDictionary objects?
- iOS 9: How to change volume programmatically without showing system sound bar popup?
- Detect airplane mode on iOS
- Method overloading in Objective-C?
- Objective C – Assign, Copy, Retain
- Workaround on the threads limit in Grand Central Dispatch?
- Disable iOS8 Quicktype Keyboard programmatically on UITextView
- Should I declare variables in interface or using property in objective-c arc?
- How do I give an “identifier” to a view controller within my storyboard?
- iOS Prefix.pch best practices
- Objective-C 101 (retain vs assign) NSString
- no umbrella header found for target, module map will not be generated
- ‘Receiver () has no segue with identifier ‘addSegue’
- How to use local-only project via CocoaPods
- How to handle iphone screen sizes/resolution for background images
- Find current country from iPhone device
- On iOS8, displaying my app in landscape mode will hide the status bar but on iOS 7 the status bar is displayed on both orientations
- NSNumberFormatter and ‘th’ ‘st’ ‘nd’ ‘rd’ (ordinal) number endings
- iPhone SDK Internet connection detection
- iOS SecKeyRef to NSData
- AVSpeechSynthesizer output as file?
- iPhone storage in tmp directory
- MKMapView show incorrectly saved region