Navigation

Operators and Keywords

Function List:

C++ API

: [total, user, system] = cputime ();

Return the CPU time used by your Octave session.

The first output is the total time spent executing your process and is equal to the sum of second and third outputs, which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode, respectively.

If your system does not have a way to report CPU time usage, cputime returns 0 for each of its output values.

Note that because Octave used some CPU time to start, it is reasonable to check to see if cputime works by checking to see if the total CPU time used is nonzero.

See also: tic, toc.

Package: octave