0

I have a short program that basically write a transaction to a blockchain. I want to measure how long it takes for writing the transaction. Is there a way I can measure the runtime excluding the effect of the hardware (like CPU, how many applications my laptop was running at the time I make the execution, etc)? I found some sources saying using timestamp but I doubt if it involves a lots of factors or not.

The timestamps in Python is something like:

import time
start_time = time.time()
main()
print("--- %s seconds ---" % (time.time() - start_time))

I found this code from this link: How do I get time of a Python program's execution?

0 Answers0