测试代码:
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