Ask Your Question
0

Measuring the code time but in which unity

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

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

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

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
0

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

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

Stats

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

Seen: 260 times

Last updated: Jun 23 '20