time in python code

import time

start = time.time()
print("hello")
end = time.time()
print(end - start)

Here is what the above code is Doing:
1. It’s creating a start variable and setting it equal to the current time.
2. It’s printing “hello”.
3. It’s creating an end variable and setting it equal to the current time.
4. It’s printing the difference between the end and start variables.

The output of the above code is:
hello
0.0

The output of the above code is 0.0 because the time it takes to print “hello” is so small that it’s not measurable.

Let’s try something a bit more challenging.