5.3.8 timer
-----------
Type:
int
Purpose:
1. the CPU time (i.e, user and system time) used for each command is
printed if timer >0 , if this
time is bigger than a (customizable) minimal time and
if printlevel+1 >= voice (which is by default true on the
SINGULAR top level, but not true while procedures are executed).

2. yields the used CPU time since the start-up of SINGULAR in a
(customizable) resolution.

The default setting of timer is 0, the default minimal time is
0.5 seconds, and the default timer resolution is 1 (i.e., the default unit
of time is one second). The minimal time and timer resolution
can be set using the command line options --min-time and
--ticks-per-sec and can be checked using
system("--min-time") and system("--ticks-per-sec").

How to use timer in order to measure the time for a sequence of
commands, see example below.

Note for Windows95/98:
The value of the timer cannot be used (resp. trusted) when
SINGULAR is run under Windows95/98 (this is due to the shortcomings
of the Windows95/98 operating system). Use rtimer, instead.

Example:
  timer=1; // The time of each command is printed
  int t=timer; // initialize t by timer
  ring r=0,(x,y,z),dp;
  poly p=(x+2y+3z+4xy+5xz+6yz)^20;
  // timer as int_expression:
  t=timer-t;
  t;  // yields the time in ticks-per-sec (default 1)
==> 0
      // since t was initialized by timer
  int tps=system("--ticks-per-sec");
  t/tps; // yields the time in seconds truncated to int
==> 0
See
Command line options;
printlevel;
rtimer;
system;
voice.
<font size="-1">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User manual for <a href="http://www.singular.uni-kl.de/"><i>Singular</i></a> version 2-0-4, October 2002,
generated by <a href="http://www.gnu.org/software/texinfo/"><i>texi2html</i></a>.
</font>

</body>
</html>
