We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2958 - For event timestamps, use high precision counter
Summary: For event timestamps, use high precision counter
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-23 18:17 UTC by Mike Lawrence
Modified: 2019-11-17 06:39 UTC (History)
0 users

See Also:


Attachments
diff for suggested path (16.14 KB, text/plain)
2015-04-23 18:17 UTC, Mike Lawrence
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lawrence 2015-04-23 18:17:38 UTC
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.
Comment 1 Sam Lantinga 2016-10-08 00:31:57 UTC
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?
Comment 2 Mike Lawrence 2019-10-18 14:19:15 UTC
(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.
Comment 3 Sam Lantinga 2019-11-17 06:39:32 UTC
Okay, thanks for the update!