timetic

版本 1.0.0.0 (3.7 KB) 作者: David Gleich
An object oriented implementation of tic and toc for nested timing.
1.9K 次下载
更新时间 2006/9/27

无许可证

The tic and toc functions manipulate a single global time variable and are not suitable for internal function timing when external routines may also perform independent timing.

The timetic object rectifies this deficiency in Matlab and creates a proper object-oriented timing class.

t1 = timetic;
tic(t1);
% compute
t2 = timetic;
tic(t2);
% compute
toc(t2)
% compute
toc(t1)

The times reported by the two toc commands are precisely the times between the tic and toc commands.

Further, the timetic class extends the tic/toc paradigm by adding pause, start, and set operations to manipulate a timer.

tt = timetic;
tic(t1);
pause(t1);
% do some complicated output
start(t1); % restarts t1 without resetting the total elapsed time
toc(t1);

引用格式

David Gleich (2024). timetic (https://www.mathworks.com/matlabcentral/fileexchange/12422-timetic), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0