WaitSecs,如果等待秒数为负数,会怎么样

测试代码:

t1 = GetSecs;
WaitSecs(-0.12);
t2 = GetSecs-t1;
disp(['t2:',num2str(t2)])

测试结果:

 WaitSecs_test
t2:6.77e-05
>> WaitSecs_test
t2:9.11e-05
>> WaitSecs_test
t2:0.000175
>> WaitSecs_test
t2:8.54e-05
>> WaitSecs_test
t2:0.0002357
>> WaitSecs_test
t2:3.81e-05
>> WaitSecs_test
t2:2.75e-05
>> WaitSecs_test
t2:2.74e-05
>> WaitSecs_test
t2:3.01e-05
>> WaitSecs_test
t2:2.91e-05

然后我试了一下等待时间为0的情况:

>> WaitSecs_test
t2:0.0005102
>> WaitSecs_test
t2:2.65e-05
>> WaitSecs_test
t2:3.3e-05
>> WaitSecs_test
t2:3.14e-05
>> WaitSecs_test
t2:2.83e-05
>> WaitSecs_test
t2:2.98e-05
>> WaitSecs_test
t2:3.38e-05
>> WaitSecs_test
t2:2.78e-05
>> WaitSecs_test
t2:2.48e-05
>> WaitSecs_test
t2:2.96e-05

所以总结一下,当等待时间为负数时,应该就当0处理了。

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值