简体   繁体   English

在 Octave 中使用不带“toc”的“tic”

[英]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.快速背景,Octave GUI 版本 6.2.0 在一台计算机上初始化至少需要 20-30 秒,但在另一台运行相同版本和相同操作系统的计算机上需要 1-2 秒。 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.我想找出阻碍的地方,所以我在octaverc启动文件中的不同位置使用了tictoc计时器函数。 At some point, I noticed that merely having tic at the very end of the startup file completely fixed the slow initialize time.在某些时候,我注意到仅仅在启动文件的末尾tic就完全解决了缓慢的初始化时间问题。

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?因此,虽然我的主要问题已解决(尽管我不知道为什么会这样),但我想看看在 Octave session 中使用tic而从未使用过toc是否会导致任何问题,例如,这是否会使一些计时器进程在背景? 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 ). tic将当前时钟时间存储在一个内部变量中(请参阅此处tic_toc_timestamptic的源代码从该行之后开始), toc将当前时钟时间与存储的变量进行比较(请参阅此处的源代码)。

So, no, there's no timer running in the background after you call tic .所以,不,调用tic后,后台没有运行计时器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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