Units for Tic/Toc?

조회 수: 14 (최근 30일)
Tyler
Tyler 2016년 8월 22일
답변: Star Strider 2016년 8월 22일
Hi all,
I would just like to verify that the units for tic/toc are always in seconds. If I run something for multiple days, will it still read an answer in seconds (e.g. 6 days, 4 hours ~ 532800 seconds)? I would prefer not to test this one out.
Thanks!

채택된 답변

Star Strider
Star Strider 2016년 8월 22일
According the the documentation, yes. (I’ve not tried it myself, either.) I did use clock and etime when I ran simulations that ran all night, and they accumulated accurately over several hours, so if you have any doubts, use them.
You can get the days-hours-minutes-seconds using the regular date functions:
TotalTime = datevec(datenum([0 0 0 0 0 532800]));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by