统计时间代码

NSDate* tmpStartData = [NSDate date];

//You code here...

double deltaTime = [[NSDate date] timeIntervalSinceDate:tmpStartData];

NSLog(@"cost time = %f", deltaTime);




@property(nonatomic,strong) NSDate* sdTime_BeginLoadCGFStart1;

XAppDelegate.sdTime_BeginLoadCGFStart1 =[NSDate date];

NSLog(@"开始请求Good/GetCategoryBar接口sdTime_Start_Good/GetCategoryBar");



double sdTime_End =[[NSDate date]timeIntervalSinceDate:XAppDelegate.sdTime_BeginLoadCGFStart1];

NSLog(@"结束请求Good/GetCategoryBar接口sdTime_End___Good/GetCategoryBar: %f",sdTime_End);

NSLog(@"");

你可能感兴趣的:(统计时间代码)