Here is my code
import datetime
n = raw_input()
print "aaa"
a = datetime.datetime.now()
for i in xrange(1,100000):
x = 0
for i in n:
x = ord(i)-48 + 10*x
b = datetime.datetime.now()
print x,b-a
n = raw_input()
print "aaa"
a = datetime.datetime.now()
for i in xrange(1,100000):
x = int(n)
b = datetime.datetime.now()
print x,b-a
On my System I am getting this various times for same value 5 for both input, Why am I getting this different values and also that these values are not consistently in same order does it has anything to do with my input typing timing or branching in computers
case 1:
5
aaa
5 0:00:00.112000
5
aaa
5 0:00:00.104000
case 2:
5
aaa
5 0:00:00.108000
5
aaa
5 0:00:00.140000
case 3:
5
aaa
5 0:00:00.114000
5
aaa
5 0:00:00.107000
case 4:
5
aaa
5 0:00:00.110000
5
aaa
5 0:00:00.124000