Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Python interpreter. Accordingly, the first time the calculation is slower. The following times the bycode is already executed. However, different implementations (versions, builds) of Python, on different platforms, for different data types on the same physical machine will use a different number of machine cycles. The question is incorrect IMHO. It is more correct to ask, for example, how long does an integer addition operation take on average in Python 2.7 on a Windows 8 x86 platform.
A strange question - at least what types are you going to add?
If you are interested in running time - profile through the tools built into python or the time utility. If for a task it is necessary to count cycles, then you need to look at C / ASM or another system language without garbage collection, but not at all at managed scripting languages, where it is unlikely that you can take and find out exactly how many cycles this or that operation will take, but stop the world for garbage collection will hang the entire application at the most inopportune moment.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question