Read-only forum archive

Timings in Singular

Timings in Singular

E-mail to Singular-Team · Thu Sep 22, 2005 5:45 pm

Hi,

I build my codes in a proc. Now I want to know the exact time of my code
consume. How do I get it?
Are there any functions such as time() in Maple which provide this
service in Singular? If so, could you provide some examples ?

Timings in Singular

lossen · Thu Sep 22, 2005 5:59 pm

There is a timer functionality in Singular. You can use it in the
following way:

Code:
> int t=timer;          // t saves the value of the timer at the beginning
> ......
> timer-t;              // elapsed time is timer minus saved timer value


Alternatively, you may use the timer as in the following example:

Code:
> system("--min-time", "0.001");
> timer=1;
> ring r=0,x,dp;
> number n=1234567;
> number m=n^100000;
//used time: 0.10 sec
> number mm=m^2;
//used time: 0.14 sec


If you are on a Windows Operating System, the value of timer might not
always be correct. There you need to use the
Code:
rtimer
command instead.
You can find further explanations and examples in the documentation
of Singular (entering help timer; or help rtimer;).

Christoph Lossen
(Singular Team)