iOS------------Calculate the execution time of a piece of code

CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();

//Write the code to calculate the time here

// do something

CFAbsoluteTime end = CFAbsoluteTimeGetCurrent();

NSLog(@"%f", end - start);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324769729&siteId=291194637