Ask Your Question

Measuring the code time but in which unity

asked 2020-06-23 17:32:29 +0200

Cyrille gravatar image

In is answer to the squestion How to properly time Sage computations? Dan Fulea propose a cheap approach which looks like this (adapted to my problem

AA = random_matrix(RR,n,m)
BB = transpose(AA)
AA2= np.array(AA)
##### Commande pour mesurer le temps pris par l'opération
import time #
temps_op = t2-t1#

But what is the measure. How to transform temps_op in second, minutes... ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-06-23 22:16:22 +0200

rburing gravatar image

You could find out just by comparing with your own measurement.

More systematically, this is explained in the Python documentation of time.time():

Return the time in seconds since the epoch as a floating point number.

So it is in seconds. I leave it as an exercise to convert it into minutes, hours, days...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-06-23 17:32:29 +0200

Seen: 250 times

Last updated: Jun 23 '20