简体   繁体   中英

Using "tic" without "toc" in Octave

Quick background, Octave GUI version 6.2.0 takes at least 20-30 seconds to initialize on one computer, but 1-2 seconds on another computer running the same version and same OS. I wanted to figure out where the holdup was, so I used the tic and toc timer functions in various places within the octaverc startup file. At some point, I noticed that merely having tic at the very end of the startup file completely fixed the slow initialize time.

So while my main issue is resolved (though I don't know why that worked), I wanted to see if using tic without ever using toc in an Octave session can cause any issues, eg, does this leave some timer process running in the background? Thanks in advance.

tic stores the current clock time in an internal variable (see tic_toc_timestamp here , the source code for tic starts right after that line), toc compares the current clock time to the stored variable (see its source code here ).

So, no, there's no timer running in the background after you call tic .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM