Quote:
Originally Posted by kamocat
I don't suppose there's any reason to perform it with changing input values, is there? Computers take just as long to multiply 0x0 as they do 57x291, correct?
|
Actually, that isn't always true. For example, the Cortex-M3 multiply timing follows:
32 bits x 32 bits = 32 bits is always one cycle
32b x 32b = 64b takes 3 cycles if the result is small
32b x 32b = 64b takes 5 cycles if the result is big
Also, it is relatively common for functions to bail early for special values, such as 0. For example, my sine function bails in less than half of the usual execution time if the input is a multiple of 45 degrees.
Quote:
Originally Posted by kamocat
Just in case, I used a random-number generator. (This prevents LabVIEW from compiling the results as constants in the program)
It took about 0.000492ms per iteration of the sine function, measured over a million iterations. To put it on the same scale as Ether's measurement, that's 0.5 microseconds.
|
Thanks!