by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.0, Creation date: 2017-08-01, Last change: 2025-08-18
See Also: cputoc
cputic
tic; for i=10000000000; x=cos(pi/16); end; toc
cputic; for i=10000000000; x=cos(pi/16); end; cputoc
f=@() cos(pi/3), timeit(f)
This function, cputic, is a simple utility designed to start a CPU time measurement. It is part of the SolidGeometry library and was introduced in version 4.0. The function is authored by Tim C. Lueth and is categorized under auxiliary procedures.
The function cputic does not take any input parameters. It is called without arguments.
The function uses a global variable ctic_tic to store the current CPU time when the function is called. This variable is used to keep track of the start time for a CPU time measurement.
ctic_tic.cputime function, to the global variable ctic_tic.The function is used to mark the start of a CPU time measurement. It is typically used in conjunction with the cputoc function, which calculates the elapsed CPU time since cputic was called.
Here is an example of how cputic can be used:
tic; for i=10000000000; x=cos(pi/16); end; toc cputic; for i=10000000000; x=cos(pi/16); end; cputoc f=@() cos(pi/3), timeit(f)
In this example, cputic is used to start the CPU time measurement before a loop, and cputoc is used to end the measurement and display the elapsed CPU time.