BayES BayES

B.3 Elapsed-time statements

The following statements are used to measure and report the time that elapses between two points (defined by the user) in the execution of code.



Syntax

Arguments and performed function



tic([s]);

Starts a timer that can be used to measure the amount of time that elapses until a toc([s]); statement is encountered. If s is provided then the corresponding call to toc() must use the same string as identifier.

  • s must be a string



toc([s]);

Prints information on the time that elapsed between a call to the tic() function and the current call to toc(). If s is provided then it must be the same as the string used in the call of a previous tic. In this case toc(s); prints the amount of time that elapsed between the tic(s); and the toc(s); statements. If toc is called without an argument then it prints the time that elapsed from the previous call to tic() (without an argument as well).
With this scheme BayES allows setting multiple timers and periodically reporting the time that elapsed when executing statements.
All set tics are cleared once the BayES parser completes a job.

  • s must be a string



ctic([s]);

To economize on memory and CPU resources, BayES allows only a limited number of tics to be set simultaneously. When a tic that was previously set by the user is not expected to be used again, a call to ctic() should be made to clear it from memory and make space for other tics to be set. If the function is called without an argument, then it clears the last tic which was defined without an argument.
All set tics are cleared once the BayES parser completes a job.

  • s must be a string


Share this content:
Facebook Twitter LinkedIn Email
© 2016–20 Grigorios Emvalomatis