Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c TimeIntervalenceDate返回的时间单位是什么?_Objective C_Nsdate - Fatal编程技术网

Objective c TimeIntervalenceDate返回的时间单位是什么?

Objective c TimeIntervalenceDate返回的时间单位是什么?,objective-c,nsdate,Objective C,Nsdate,TimeIntervalenceDate返回的时间单位是什么?是几秒钟,几毫秒还是别的什么 文档中说它返回一个NSTimeInterval,但该值是什么时间单位?它返回秒数,作为NSTimeInterval值 发件人: NSTimeInterval始终以秒为单位指定;它在10000年的范围内产生亚毫秒的精度 那么,NSDate将函数原型显示为: -(NSTimeInterval)timeIntervalSinceDate:(NSDate*)另一个日期 和基础数据类型表示: NSTimeInter

TimeIntervalenceDate返回的时间单位是什么?是几秒钟,几毫秒还是别的什么


文档中说它返回一个NSTimeInterval,但该值是什么时间单位?

它返回秒数,作为
NSTimeInterval

发件人:

NSTimeInterval始终以秒为单位指定;它在10000年的范围内产生亚毫秒的精度


那么,
NSDate
将函数原型显示为:

-(NSTimeInterval)timeIntervalSinceDate:(NSDate*)另一个日期

和基础数据类型表示:

NSTimeInterval始终以秒为单位指定;它产生 超过10000年的亚毫秒精度


NSTimeInterval
实际上不是一个对象。它只是一个双精度值。实际上,
NSTimeInterval
总是以秒为单位指定的。如果以秒为单位,我如何计算毫秒?因为1秒=1000ms,
[NSDate timeIntervalSinceDate:foo]*1000
应该是毫秒。@esqew-啊,我忘了这一点。NSTimeInterval有一个小数点以及后面的数字。From:用于指定时间间隔,以秒为单位<代码>类型定义双时间间隔。NSTimeInterval始终以秒为单位指定