Discussion Overview
The discussion revolves around calculating the time difference in milliseconds between two events using the C programming language's time.h header. Participants explore various methods and functions available on different operating systems, particularly focusing on alternatives to the difftime function for more precise measurements.
Discussion Character
- Technical explanation, Debate/contested
Main Points Raised
- One participant notes that the difftime function measures time differences in seconds and seeks a method for milliseconds.
- Another participant suggests using QueryPerformanceCounter() on Windows, mentioning its ability to provide ticks since the last call and the frequency of those ticks.
- A participant using Linux mentions gettimeofday() as a function that provides microseconds since the start of the day but expresses uncertainty about its update frequency.
- Another participant reiterates the use of gettimeofday() and suggests looking for alternatives to QueryPerformanceCounter() for Linux users, providing a link to further details.
Areas of Agreement / Disagreement
Participants present multiple competing views regarding the appropriate functions to use on different operating systems, indicating that there is no consensus on a single solution for measuring time differences in milliseconds.
Contextual Notes
Participants express uncertainty about the frequency of updates for the gettimeofday() function and the specifics of alternatives to QueryPerformanceCounter() on Linux, highlighting potential limitations in their suggestions.