- 第一种
直接用CF提供的C函数来计算
CFTimeInterval currentTime = CFAbsoluteTimeGetCurrent();
-第二种
用一个对象的方法来计算
NSDate *begin = [NSDate date];
NSDate *end = [NSDate date];
NSTimeInterval time = [end timeIntervalSinceDate:begin];
CFTimeInterval currentTime = CFAbsoluteTimeGetCurrent();
-第二种
用一个对象的方法来计算
NSDate *begin = [NSDate date];
NSDate *end = [NSDate date];
NSTimeInterval time = [end timeIntervalSinceDate:begin];
本文标题:计算两个时间相差的秒数
本文链接:https://www.haomeiwen.com/subject/jlvwxqtx.html
网友评论