| Summary: | For event timestamps, use high precision counter | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Mike Lawrence <mike.lwrnc> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | diff for suggested path | ||
Out of curiosity, what use case do you have for < 1ms resolution on the event timestamp, given that the timestamp is only when the last SDL_PumpEvents() call was made? (I thought I responded to Sam's question way back in 2016, but happeened across thread in my email just now and see that my response bounced, so I'm posting my response now) I do cognitive science research that often involves measuring human response times where phenomena of interest may be on the order of merely several milliseconds. A higher precision event timestamp well help reduce noise and thereby improve statistical power. Note I've actually started using pyusb in a completely separate process to collect responses and their timestamps, so having the higher precision event timestamps in SDL isn't a big deal for me personally any more. Okay, thanks for the update! |
Created attachment 2131 [details] diff for suggested path Simply requires replacement of "SDL_GetTicks()" with "SDL_GetPerformanceCounter()" in events/SDL_events.c and replacement of all instances of "Uint32 timestamp" with "Uint64 timestamp" in include/SDL_events.h. Diff for patch attached.