介紹:
可以很方便獲取某段代碼的執(zhí)行時(shí)間。使用十分簡單,只需將某段需要獲取執(zhí)行時(shí)間的代碼加進(jìn)logTimeTakenToRunBlock即可。例如:
[self logTimeTakenToRunBlock:^{
for(int i = 0 ; i < 1000000000; i ++);
} withPrefix:@"codingke"];
其他(Others) MKBlockTimer
測試環(huán)境:
測試環(huán)境:Xcode 4.5, iOS 5.0 以上。
效果圖:
使用方法:
可以很方便獲取某段代碼的執(zhí)行時(shí)間。使用十分簡單,只需將某段需要獲取執(zhí)行時(shí)間的代碼加進(jìn)logTimeTakenToRunBlock即可。例如:
[self logTimeTakenToRunBlock:^{
for(int i = 0 ; i < 1000000000; i ++);
} withPrefix:@"codingke"];