- RDTSC
- OS might swap out your code and move it back in, which influence the accuracy.
- the number of cycles != the Number of instructions.
- QueryPerformanceCounter and QueryPerformanceFrequency
- Union and an example: LARGE_INTEGER
- Writing variable into string:
If you put extra “%” into format string, wsprintf(cannot print floating numbers) will read into stacks it shouldn’t read into.
- While assigning a calculation result into a different typed variable, do the cast before calculation.
int x, y;
float z = (float)x / (float)y;
- Intrinsic functions
- A blog to read
- Due to SIMD, floating operations can be done as twice amount as double operations, thus, for the same amount of work, floating is faster than double.