New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event processing seems to be slow and dependent on the SDL_Delay interval between frames #6479
Comments
Looking at this from the outside with no testing, would it not make sense for the polling for events to take longer if there were ongoing events arriving during this period? I know you say that you didn't move the mouse, but your output isn't showing how many events are being processed, so I'd suggest you check that as a starting point (especially for the longer intervals). Also you may want to try switching to |
Before creating this issue, I checked if the queue was actually empty, so I did not include it in the logs. Anyway, it is logical that if I do not move the mouse over the window and do not press the keys, then no events are generated. Okay, here are the logs with added event count tracking and comments that indicate problematic lines. This time, I alternately did nothing and tested the event generation by moving the cursor over the window. I removed the excess lines showing time: 0.010ms | sample: 104 | events: 0
time: 0.148ms | sample: 1484 | events: 11 // 11 events, 0.148ms - bad
time: 0.048ms | sample: 477 | events: 22
time: 0.010ms | sample: 103 | events: 0
time: 0.046ms | sample: 464 | events: 0
time: 0.046ms | sample: 461 | events: 0
time: 0.046ms | sample: 462 | events: 0
time: 0.310ms | sample: 3104 | events: 28 // 0.310ms to process 28 events
time: 0.175ms | sample: 1748 | events: 29
time: 0.026ms | sample: 257 | events: 0
time: 0.201ms | sample: 2010 | events: 0 // 0.201ms but no events processed...
time: 0.013ms | sample: 129 | events: 0
time: 0.048ms | sample: 480 | events: 0
time: 0.010ms | sample: 103 | events: 0
time: 0.010ms | sample: 101 | events: 11 // 11 events, only 0.010ms
time: 0.011ms | sample: 109 | events: 0
time: 0.043ms | sample: 425 | events: 5
time: 0.011ms | sample: 108 | events: 12 // 0.011ms to process 12 events
time: 0.010ms | sample: 102 | events: 0
time: 0.047ms | sample: 470 | events: 0
time: 0.010ms | sample: 102 | events: 0
time: 0.047ms | sample: 473 | events: 0
time: 0.047ms | sample: 466 | events: 0
time: 0.012ms | sample: 118 | events: 21 // 21 events, only 0.012ms to process
time: 0.047ms | sample: 467 | events: 26 // 26 events, only 0.047ms
time: 0.011ms | sample: 109 | events: 0
time: 0.042ms | sample: 417 | events: 25 // 25 events, only 0.042ms
time: 0.010ms | sample: 100 | events: 17 // 17 events, only 0.010ms
time: 0.162ms | sample: 1615 | events: 26 // 26 events, but many times longer processing
time: 0.047ms | sample: 471 | events: 16 // 16 events, 0.047ms
time: 0.010ms | sample: 100 | events: 14
time: 0.010ms | sample: 102 | events: 0
time: 0.047ms | sample: 466 | events: 0
time: 0.010ms | sample: 103 | events: 0
time: 0.047ms | sample: 465 | events: 0
time: 0.049ms | sample: 488 | events: 0
time: 0.048ms | sample: 481 | events: 16 // 16 events - again 0.048ms
time: 0.010ms | sample: 100 | events: 0
time: 0.049ms | sample: 486 | events: 0
time: 0.010ms | sample: 100 | events: 0
time: 0.011ms | sample: 110 | events: 0
time: 0.047ms | sample: 470 | events: 0
time: 0.011ms | sample: 106 | events: 0
time: 0.192ms | sample: 1925 | events: 12 // 0.192ms to process 12 events?!
time: 0.010ms | sample: 103 | events: 31 // 0.010ms to process 31 events - what a difference!
time: 0.048ms | sample: 483 | events: 26
time: 0.010ms | sample: 100 | events: 0
time: 0.047ms | sample: 465 | events: 2
time: 0.009ms | sample: 93 | events: 3
time: 0.047ms | sample: 473 | events: 19 // 19 events, 0.047ms
time: 0.009ms | sample: 93 | events: 0
time: 0.049ms | sample: 489 | events: 0
{...} As can be clearly seen in the logs, when events appear in the queue, their processing time varies greatly. SDL can return Another problem I noticed is that when you drag a window with the mouse, by grabbing its title bar, it adds moving time to adding the event processing time itself. Example for time: 0.024ms | sample: 241 | events: 10
time: 0.346ms | sample: 3462 | events: 22
time: 0.010ms | sample: 104 | events: 27
time: 0.050ms | sample: 500 | events: 17
time: 0.051ms | sample: 508 | events: 14
time: 0.046ms | sample: 461 | events: 0
time: 2160.101ms | sample: 21601013 | events: 2 // time of moving window is added to the sample
time: 0.287ms | sample: 2870 | events: 0
time: 0.042ms | sample: 417 | events: 10
time: 0.047ms | sample: 468 | events: 23
time: 0.047ms | sample: 470 | events: 0
time: 0.010ms | sample: 103 | events: 5 I held the window by the title bar and moved it for about two seconds. The time of holding and moving the window has been added to the measurement — why? This happens at any And this is the test for // doing nothing:
time: 1.131ms | sample: 11307 | events: 0 // A la la la la long long li long long long, oh yeah!
time: 0.454ms | sample: 4544 | events: 0
time: 0.441ms | sample: 4410 | events: 0
time: 0.653ms | sample: 6534 | events: 0
time: 0.433ms | sample: 4333 | events: 0
time: 0.746ms | sample: 7463 | events: 0
time: 0.548ms | sample: 5476 | events: 0
time: 0.456ms | sample: 4562 | events: 0
time: 0.620ms | sample: 6199 | events: 0
time: 0.439ms | sample: 4390 | events: 0
time: 0.656ms | sample: 6565 | events: 0
// moving the mouse over the window:
time: 0.622ms | sample: 6224 | events: 2
time: 0.619ms | sample: 6186 | events: 3
time: 2.047ms | sample: 20474 | events: 2
time: 1.361ms | sample: 13611 | events: 3
time: 0.660ms | sample: 6595 | events: 2
time: 1.066ms | sample: 10658 | events: 2
time: 0.887ms | sample: 8870 | events: 3
time: 0.654ms | sample: 6542 | events: 2
time: 0.617ms | sample: 6168 | events: 3
time: 0.672ms | sample: 6719 | events: 2
time: 0.602ms | sample: 6019 | events: 3
time: 1.153ms | sample: 11528 | events: 2
time: 1.354ms | sample: 13538 | events: 3
time: 0.688ms | sample: 6879 | events: 2
time: 0.725ms | sample: 7253 | events: 3
time: 0.646ms | sample: 6463 | events: 2
time: 0.856ms | sample: 8562 | events: 3
time: 0.978ms | sample: 9775 | events: 2
time: 0.446ms | sample: 4458 | events: 2
time: 0.444ms | sample: 4444 | events: 0
time: 0.437ms | sample: 4370 | events: 0
time: 0.672ms | sample: 6721 | events: 1
time: 2.953ms | sample: 29532 | events: 3
time: 0.473ms | sample: 4729 | events: 0
time: 0.443ms | sample: 4434 | events: 0
time: 0.441ms | sample: 4413 | events: 0
time: 0.444ms | sample: 4444 | events: 0
time: 0.446ms | sample: 4461 | events: 0
time: 0.446ms | sample: 4462 | events: 0
time: 1.435ms | sample: 14351 | events: 0 // WTF is this...
time: 0.451ms | sample: 4511 | events: 0
time: 0.448ms | sample: 4476 | events: 0
time: 0.450ms | sample: 4503 | events: 0 When no events is processed, the times are significantly longer. For the // doing nothing:
time: 4.594ms | sample: 45936 | events: 0
time: 5.578ms | sample: 55778 | events: 0
time: 3.030ms | sample: 30298 | events: 0
time: 2.894ms | sample: 28938 | events: 0
time: 4.830ms | sample: 48301 | events: 0
time: 4.991ms | sample: 49907 | events: 0
time: 4.583ms | sample: 45831 | events: 0
time: 4.654ms | sample: 46535 | events: 0
time: 4.562ms | sample: 45616 | events: 0
time: 6.130ms | sample: 61298 | events: 0
time: 6.193ms | sample: 61930 | events: 0
time: 4.664ms | sample: 46643 | events: 0
time: 4.570ms | sample: 45696 | events: 0
time: 5.418ms | sample: 54185 | events: 0
time: 7.045ms | sample: 70447 | events: 0
// moving the cursor over the window:
time: 7.582ms | sample: 75824 | events: 2
time: 6.830ms | sample: 68295 | events: 1
time: 5.856ms | sample: 58558 | events: 1
time: 6.802ms | sample: 68017 | events: 1
time: 5.739ms | sample: 57389 | events: 1
time: 5.226ms | sample: 52257 | events: 0
time: 4.910ms | sample: 49103 | events: 1
time: 4.972ms | sample: 49716 | events: 1
time: 7.504ms | sample: 75042 | events: 1
time: 2.953ms | sample: 29532 | events: 1
time: 5.022ms | sample: 50224 | events: 1
time: 5.323ms | sample: 53233 | events: 1
time: 5.271ms | sample: 52711 | events: 1 The times are ridiculous. It's also interesting that I'm moving the cursor all the time, making circles, but the queue only gets one event each second. The situation is different if I also click LMB while making circles with the cursor: time: 6.046ms | sample: 60461 | events: 11
time: 4.670ms | sample: 46701 | events: 5
time: 7.254ms | sample: 72539 | events: 9
time: 11.297ms | sample: 112965 | events: 20
time: 12.228ms | sample: 122276 | events: 21
time: 15.361ms | sample: 153605 | events: 17
time: 10.515ms | sample: 105149 | events: 15
time: 8.147ms | sample: 81474 | events: 3
time: 15.132ms | sample: 151317 | events: 17
time: 12.836ms | sample: 128358 | events: 21
time: 12.371ms | sample: 123712 | events: 21
time: 12.695ms | sample: 126953 | events: 21
time: 16.724ms | sample: 167241 | events: 26
time: 12.847ms | sample: 128474 | events: 23
time: 10.596ms | sample: 105959 | events: 17
time: 10.694ms | sample: 106942 | events: 13 There are many events in the queue, but I didn't click 21 times per second, but only few times per second (3-5), so the rest of the events must be related to the mouse movement. It should also be taken into account that if the It is difficult for me to say why the measurements look like this, and it is especially difficult for me to understand why manipulating the Attachment — timming_test_2.zip Here is the code template of these programs: {$MODE OBJFPC}
uses
SDL2;
var
Window: PSDL_Window;
Event: TSDL_Event;
var
Stopped: Boolean = False;
var
TicksLast: Int64;
TicksCurrent: Int64;
var
CounterBegin: Int64;
CounterEnd: Int64;
CounterSample: Int64;
CounterPerSecond: Int64;
var
EventsTime: Single = 0.0;
EventsAccu: Int32 = 0;
begin
SDL_Init(SDL_INIT_EVERYTHING);
Event := Default(TSDL_Event);
Window := SDL_CreateWindow(nil, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_SHOWN);
CounterPerSecond := SDL_GetPerformanceFrequency();
TicksLast := SDL_GetTicks64() div (1000 div 4);
repeat
CounterBegin := SDL_GetPerformanceCounter();
while SDL_PollEvent(@Event) = 1 do
begin
EventsAccu += 1;
if Event.Type_ = SDL_QUITEV then
Stopped := True;
end;
CounterEnd := SDL_GetPerformanceCounter();
CounterSample := CounterEnd - CounterBegin;
TicksCurrent := SDL_GetTicks64() div (1000 div 4);
if TicksCurrent <> TicksLast then
begin
EventsTime := CounterSample * 1000 / CounterPerSecond;
WriteLn('time: ', EventsTime:1:3, 'ms | sample: ', CounterSample:5, ' | events:', EventsAccu:3); // new print format
TicksLast := TicksCurrent;
EventsAccu := 0;
end;
SDL_Delay(1); // delay between frames
until Stopped;
SDL_DestroyWindow(Window);
SDL_Quit();
end. |
I'm not sure if it matters or not in this case (probably not), but the implementation of SDL_AtomicGet and SDL_AtomicGetPrt are a bit ugly in my opinion. In a worse case scenario those could lead to an infinite/long loop. E.g. in case of Edit: using |
To measure only time spent in SDL, on Linux, you could use |
@meyraud705: for clarification, I'm using Windows 10 64-bit.
I know where this time is spent — this goddamn I converted my test program to one that uses {$MODE OBJFPC}
uses
SDL2;
var
Window: PSDL_Window;
Event: PSDL_Event;
EventsNum: Integer;
EventsBuff: array [0 .. 255] of TSDL_Event;
var
Stopped: Boolean = False;
var
TicksLast: Int64;
TicksCurrent: Int64;
var
CounterBegin: Int64;
CounterEnd: Int64;
CounterSample: Int64;
CounterPerSecond: Int64;
var
EventsTime: Single = 0.0;
EventsAccu: Int32 = 0;
begin
SDL_Init(SDL_INIT_EVERYTHING);
Window := SDL_CreateWindow(nil, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_SHOWN);
CounterPerSecond := SDL_GetPerformanceFrequency();
TicksLast := SDL_GetTicks64() div (1000 div 4);
repeat
CounterBegin := SDL_GetPerformanceCounter();
SDL_PumpEvents();
EventsNum := SDL_PeepEvents(@EventsBuff, 256, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
Event := @EventsBuff[0];
while EventsNum > 0 do
begin
if Event^.Type_ = SDL_QUITEV then
begin
Stopped := True;
Break;
end;
Event += 1;
EventsAccu += 1;
EventsNum -= 1;
end;
CounterEnd := SDL_GetPerformanceCounter();
CounterSample := CounterEnd - CounterBegin;
TicksCurrent := SDL_GetTicks64() div (1000 div 4);
if TicksCurrent <> TicksLast then
begin
EventsTime := CounterSample * 1000 / CounterPerSecond;
WriteLn('time: ', EventsTime:1:3, 'ms | sample: ', CounterSample:5, ' | events:', EventsAccu:3);
TicksLast := TicksCurrent;
EventsAccu := 0;
end;
SDL_Delay(1);
until Stopped;
SDL_DestroyWindow(Window);
SDL_Quit();
end. As you can see, the measurement is about calling time: 0.029ms | sample: 294 | events: 13
time: 0.008ms | sample: 83 | events: 3
time: 0.075ms | sample: 754 | events: 0
time: 0.335ms | sample: 3349 | events: 16 // too long
time: 0.040ms | sample: 400 | events: 31
time: 0.008ms | sample: 84 | events: 31
time: 0.168ms | sample: 1679 | events: 32 // too long
time: 0.163ms | sample: 1631 | events: 31 // too long
time: 0.191ms | sample: 1905 | events: 31 // too long
time: 0.009ms | sample: 87 | events: 31
time: 0.349ms | sample: 3491 | events: 32 // too long
time: 0.162ms | sample: 1624 | events: 31 // too long
time: 0.040ms | sample: 398 | events: 31
time: 0.008ms | sample: 82 | events: 31
time: 0.174ms | sample: 1735 | events: 32 // too long
time: 0.008ms | sample: 84 | events: 14
time: 0.045ms | sample: 449 | events: 0
time: 0.009ms | sample: 86 | events: 0
time: 0.085ms | sample: 851 | events: 2
time: 0.008ms | sample: 83 | events: 0
time: 0.044ms | sample: 438 | events: 0 If I exclude the repeat
SDL_PumpEvents(); // before starting the measurement
CounterBegin := SDL_GetPerformanceCounter();
EventsNum := SDL_PeepEvents(@EventsBuff, 256, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
Event := @EventsBuff[0];
while EventsNum > 0 do
begin
if Event^.Type_ = SDL_QUITEV then
begin
Stopped := True;
Break;
end;
Event += 1;
EventsAccu += 1;
EventsNum -= 1;
end;
CounterEnd := SDL_GetPerformanceCounter();
CounterSample := CounterEnd - CounterBegin;
{...} the times are stable and very low (usually 1μs, very rarely 2μs) even though I am generating tons of events: time: 0.001ms | sample: 5 | events: 30
time: 0.001ms | sample: 5 | events: 20
time: 0.001ms | sample: 6 | events: 0
time: 0.002ms | sample: 21 | events: 2
time: 0.001ms | sample: 6 | events: 0
time: 0.001ms | sample: 5 | events: 30
time: 0.001ms | sample: 5 | events: 38
time: 0.001ms | sample: 6 | events: 40
time: 0.001ms | sample: 5 | events: 42
time: 0.001ms | sample: 14 | events: 50
time: 0.001ms | sample: 5 | events: 43
time: 0.001ms | sample: 6 | events: 53
time: 0.001ms | sample: 5 | events: 47
time: 0.001ms | sample: 6 | events: 47
time: 0.001ms | sample: 5 | events: 45
time: 0.001ms | sample: 6 | events: 53
time: 0.001ms | sample: 6 | events: 47
time: 0.001ms | sample: 9 | events: 48
time: 0.001ms | sample: 6 | events: 40
time: 0.001ms | sample: 6 | events: 51
time: 0.001ms | sample: 6 | events: 47
time: 0.001ms | sample: 14 | events: 52
time: 0.001ms | sample: 6 | events: 25
time: 0.001ms | sample: 5 | events: 7
time: 0.001ms | sample: 5 | events: 0
time: 0.001ms | sample: 6 | events: 0
time: 0.001ms | sample: 5 | events: 6
time: 0.001ms | sample: 5 | events: 40
time: 0.001ms | sample: 6 | events: 47
time: 0.001ms | sample: 6 | events: 48
time: 0.001ms | sample: 6 | events: 47
time: 0.000ms | sample: 4 | events: 44
time: 0.001ms | sample: 5 | events: 43
time: 0.001ms | sample: 5 | events: 52
time: 0.001ms | sample: 7 | events: 44
time: 0.000ms | sample: 4 | events: 46
time: 0.000ms | sample: 4 | events: 46
time: 0.001ms | sample: 5 | events: 29
time: 0.001ms | sample: 6 | events: 10
time: 0.001ms | sample: 6 | events: 6 Conclusion — repeat
CounterBegin := SDL_GetPerformanceCounter();
SDL_PumpEvents();
CounterEnd := SDL_GetPerformanceCounter();
CounterSample := CounterEnd - CounterBegin;
{...} the results are unambiguous: time: 0.193ms | sample: 1934 | events: 26 // too long
time: 0.008ms | sample: 82 | events: 31
time: 0.039ms | sample: 392 | events: 31
time: 0.008ms | sample: 79 | events: 31
time: 0.206ms | sample: 2062 | events: 32 // too long
time: 0.008ms | sample: 79 | events: 31
time: 0.039ms | sample: 390 | events: 31
time: 0.178ms | sample: 1777 | events: 31 // too long
time: 0.232ms | sample: 2316 | events: 32 // too long
time: 0.055ms | sample: 546 | events: 25
time: 0.039ms | sample: 391 | events: 30
time: 0.008ms | sample: 82 | events: 30
time: 0.952ms | sample: 9519 | events: 43 // too long
time: 1.323ms | sample: 13228 | events: 47 // too long
time: 0.040ms | sample: 396 | events: 42
time: 0.008ms | sample: 82 | events: 44
time: 0.219ms | sample: 2190 | events: 51 // too long
time: 0.008ms | sample: 80 | events: 43
time: 0.039ms | sample: 391 | events: 48
time: 0.007ms | sample: 67 | events: 45
time: 0.097ms | sample: 968 | events: 43
time: 0.008ms | sample: 79 | events: 49
time: 1.818ms | sample: 18183 | events: 47 // too looooooooong!
time: 0.008ms | sample: 78 | events: 44
time: 0.045ms | sample: 445 | events: 18
time: 0.008ms | sample: 80 | events: 0
time: 0.045ms | sample: 449 | events: 0
time: 0.008ms | sample: 80 | events: 0
time: 0.045ms | sample: 447 | events: 0
time: 0.008ms | sample: 79 | events: 0
time: 0.045ms | sample: 445 | events: 0
time: 0.005ms | sample: 52 | events: 0
time: 0.008ms | sample: 81 | events: 0
time: 0.008ms | sample: 84 | events: 0
time: 0.040ms | sample: 402 | events: 9
time: 0.269ms | sample: 2687 | events: 32 // too long
time: 0.272ms | sample: 2717 | events: 13 // too long
time: 0.041ms | sample: 408 | events: 31 Sorry guys, but I don't have any evidence to think that the problem lies elsewhere than with the And the situation is the same as before, i.e. the greater the interval for |
If you are looking for the most efficient processing (and have benchmarked |
@peppy: even if @furious-programming : do you have some special sensor or what kind of videocard are you using? I think it would help to find out the bottleneck. Have you tried to set SDL_JOYSTICK_DISABLED or SDL_SENSOR_DISABLED? |
Yep, I don't disagree but was curious if there is a specific reason |
You implemented the Since 8bf32e1 , calling
No, to read event from devices, You can see that:
Unless you show more in depth profiling I going to say your system library are slow and the spike are because your system let another process run. |
As far as I know, I don't have any sensors and I don't really know what they are and what they are for. Anyway,
The graphics card is a typical integrated Intel® HD Graphic. If you need more information on the processor see documentation — Intel® Core™ i7-640LM. My laptop is Lenovo X201 Tablet, all features enabled (Turbo Boost, Hyper-Threading and so on) + 8GB RAM and SSD installed.
I also tried to initialize only @meyraud705: I pointed out that However, I would like to point out right away that the problem does not only concern my laptop, because similar results were obtained on another PC, with an AMD processor — on Windows and Linux (via Wine). And for this I have prepared packages with compiled test programs, so that you can also perform the tests yourself.
And this is intentional and expected, because |
You should also check which functions take the most "effective time" to see if they could be optimised. |
Here is a set of x86 and x64 DLLs with symbols that you can drop in and get better profiling information: |
I haven't found any additional information to suggest that SDL is at fault. I checked those dll files with symbols and found nothing new. Unfortunately for me, fortunately for SDL. If you don't see anything in the SDL sources that could slow down event pumping, there's probably nothing you can do about it and everything is in the hands of the operating system. |
I'll go ahead and close this, but if you find new information, please let us know! |
I have created a fairly complex main loop in my engine. This loop calls the logic update and rendering functions at approximately equal intervals (fixed/limited frame rate). I have neither the target logic update code nor the rendering code yet, so I implemented spinlocks that mimic the actual code.
These spinlocks consume a certain number of milliseconds over and over again by calling
SDL_GetPerformanceCounter
, so they wait a given number of milliseconds with a very high precision (usually down to a microsecond). I added code for updating and rendering time measurements, which are represented as milliseconds (as floats). If the spinlock of the logic update is to be5ms
and the rendering time is10ms
, the measurement results look something like this:A high enough precision. This is where the problem arises. Logic update is also event queue processing, so the update measurement relates to event processing and the update function (the one with a spinlock for
5ms
). The results are as follows:If I exclude the
5ms
spinlock from the measurement and measure only the event queue processing time, the results look like this:Thus, processing the event queue itself takes from a few tenths of a millisecond to even more than one millisecond (sometimes almost two milliseconds). It is unacceptable for event processing to take up to 5-10% of the time devoted to generating a frame (at 60fps). I measured the SDL event processing time by running the program and not generating any events (I didn't move the mouse, I didn't press any keys), so the events queue was empty almost all the time.
I thought the problem was with my loop, so I created a minimal test program to test the event processing only measurement. It looks like this:
Operation is simple:
The results are as follows:
As you can see, the very processing of events (despite not generating them) takes from a few hundredths of a millisecond to a few tenths of a millisecond. Now the most interesting — I change
SDL_Delay(1)
toSDL_Delay(10)
:Now event processing takes from a few hundredths of a millisecond to even
0.4ms
. Now forSDL_Delay(100)
:Processing of events takes from a few tenths of a millisecond to over one millisecond. For
SDL_Delay(500)
:Now it takes a few milliseconds all the time. For
SDL_Delay(1000)
:As you can see, the larger the
SDL_Delay
interval between individual measurements, the longer it takes to process the event queue, or at least this is what the measurements show. The larger the interval, the greater the difference in the number of ticks taken before and after the event loop.Why does the interval of the
SDL_Delay
function called between measurements affect the measurement of event processing time? After all, this function is called between measurements, not during them, so it should not affect them (only increase or decrease the number of measurements per second).The same is true if I explicitly use the
QueryPerformanceFrequency
,QueryPerformanceCounter
andSleep
functions, so this is not a problem withSDL_Delay
(especially since it usesSleep
internally).I know guys that you use C language and I use Free Pascal, so in the attachment I added test programs compiled in FPC so that you can test them on your own (Win 64-bit). Attached is the last stable library
SDL2.dll
, downloaded from this repository.There are several executable files in the attachment — the number in the executable name is the interval used in the
SDL_Delay
function called between measurements (no number in the name is a version without usingSDL_Delay
).Attachment — timming_test.zip
The text was updated successfully, but these errors were encountered: