|  |  5.3.8 timer 
See
 Command line options;
 printlevel;
 rtimer;
 system;
 voice.Type:int
Purpose:
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).
yields the CPU time used since the start-up of SINGULAR in a
(customizable) resolution.
 
The default setting of timeris 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-timeand--ticks-per-secand can be checked usingsystem("--min-time")andsystem("--ticks-per-sec"). 
How to use timerin order to measure the time for a sequence of
commands, see example below. 
Note for Windows95/98:The value of the timercannot 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 div tps; // yields the time in seconds truncated to int
==> 0
  timer=0;
  system("--ticks-per-sec",1000); // set timer resolution to ms
  t=timer; // initialize t by timer
  p=(x+2y+3z+4xy+5xz+6yz)^20;
  timer-t;  // time in ms
==> 20
 | 
 |