推送:
压缩时间计算-->时间差:
NSDate* StartTime = [NSDate date];
//图片压缩代码
double deltaTime = [[NSDate date] timeIntervalSinceDate:StartTime];
NSLog(@"cost time = %f", deltaTime);
为了防止重名,我在文件名中拼上了时间戳。NSString *path = [cachesDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"/video/%.0f%@",[NSDate date].timeIntervalSince1970,name]];