필터 지우기
필터 지우기

How can i take my system time in miliseconds

조회 수: 50 (최근 30일)
Sukumar Palo
Sukumar Palo 2011년 2월 10일
Hi
I have a program and want to create a time stem for it. Every time it gives an output i want to take my system time in that stem in milliseconds.

답변 (1개)

Walter Roberson
Walter Roberson 2011년 2월 10일
Duplicating my answer to the identical question in cssm:
Please clarify what you mean by your "system time".
If you mean "cpu time", then
tic;
%your code here
ms = round(toc * 1000);
If you mean "elapsed time", then
t0 = clock;
%your code here
ms = round(etime(clock,t0) * 1000);
However, if this needs to be done automatically, whenever something is displayed, without you having to change the code (that you might not have written), then you are probably going to have to override the system routine named "display", which probably isn't a wonderful idea.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by