etime
(不推荐;请改用 datetime
值或 between
)日期向量之间经过的时间
不推荐使用 etime
。请改用 datetime
值。要计算两个 datetime
值之间经过的时间,可以用一个值减去另一个值,或使用 between
函数。有关更新代码的详细信息,请参阅版本历史记录或Replace Discouraged Instances of Serial Date Numbers and Date Strings。
说明
示例
输入参数
提示
要确定事件持续时间,请使用
timeit
或tic
和toc
函数代替etime
和clock
。clock
函数基于系统时间,系统时间可以由操作系统定期调整,因此在进行时间比较操作时该函数可能不可靠。
算法
etime
不会将以下因素考虑在内:
闰秒
夏令时调整
时区差异
扩展功能
版本历史记录
在 R2006a 之前推出另请参阅
cputime
| between
| datetime
| duration
| calendarDuration