Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Timings in Singular
PostPosted: 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 ?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Sep 22, 2005 5:59 pm 

Joined: Wed Sep 21, 2005 1:27 pm
Posts: 10
Location: Kaiserslautern, Germany
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)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 10:57 am
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group