ios - How to log a method's execution time exactly in milliseconds? -


There is no way to determine how often the method should be executed (in milliseconds)?

NSDate * methodStart = [NSDate date]; / * ... Whatever you need to do ... * / NSDate * methodFinish = [NSDate date]; NSTime Interval Execution Time = [methodFinish timeIntervalSinceDate: Method Start]; NSLog (@ "execution time =% F", execution time);

Swift:

  Start method = NSDate () / * ... whatever you need to do. Swift 3:   

/ P> Pre> start the method = date () / * ... whatever you need to do ... * / methodfinish = date () execute execution time = methodfinish. TimeInternationalSign (method start) Print ("Execution time: \ (execution time)")

Easy to use and the sub-millisecond accuracy.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -