Read-only forum archive

Get time with a specific detail

Get time with a specific detail

rmaestre · Wed Sep 22, 2010 2:28 pm

Hello everyone!
I am testing/benchmarking codes between polybori and Singular.

In polybori (via phyton) i use the follow code to get calculation time:
Code:
a=time.time();
groebner_basis([p1,p2,p3]);
print time.time()-a;

and i get in the output: 0.000234 for example. This result is ok.

In Singular i use:
Code:
int t=0;
timer=0;
system("--ticks-per-sec","10000");
t=timer;
ideal BASE=slimgb([p1,p2,p3]);
print(timer-t);

and i get: 100, sometimes 200, sometimes 0 .......

How could I get a higher accuracy in reading?
What is the greatest precision?


Thank you very much.
Best regards.

Re: Get time with a specific detail

hannes · Thu Sep 23, 2010 7:45 pm

timer in Singular uses getrusage, converts it to 1/00 1/s and than adapts it
to your setting of ticks-per-sec.
That means the maximal precision is 0.01 seconds.
But remember that on multi-process systems all timings below 0.5 seconds
are not reliable.