int vs. float in benchmark testing

Bart Nessux bart_nessux at hotmail.com
Fri Feb 20 08:33:18 EST 2004


Would adding .0 to each of the numbers below turn this into a floating 
point test? Seems too easy.

def cpu_test():
    import time
    start = time.time()
    x = 0				# 0.0
    while x < 9999999:			# 9999999.0
       x = x + 1				# 1.0
       print x
    print (time.time()-start)/60
cpu_test()




More information about the Python-list mailing list