I´m converting a Linux Logger to work in windows.
The logger prints with snprintf.
In linux, this logger output timeofday.tv_usec , that give something like this :
Jun 24 18:30:31-232928 test-transport...
In my windows version, using QueryPerformanceCounter, i generate results like this:
jun 24 23:54:18-866568508 test-transport....
In Linux, the uSeconds have exactly 6 digits, but this windows function generate 9 digits. How could i print only the 6 last digits ? Remember that this is a time critical code.
Use the remainder of dividing the number by 10 to the power of the number of digits you want to preserve.
In your case: