Singular
https://www.singular.uni-kl.de/forum/

Timings in Singular
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=1457
Page 1 of 1

Author:  E-mail to Singular-Team [ Thu Sep 22, 2005 5:45 pm ]
Post subject:  Timings in Singular

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 ?

Author:  lossen [ Thu Sep 22, 2005 5:59 pm ]
Post subject: 

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)

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/