Weird, whenever I get a spike, it is followed by a sudden dip. In other words, it averages about 16-17, but when it goes over that, then it dips to 0-5 a few frames until it averages back out. Maybe it has something to do with the buffer ahead, except that I get the same thing with both DirectX and OpenGL.
Also, I tried shutting down any backgroup tasks that I could. Now the spikes accur at around 55-60. I think the over 100 spikes were due to some process, but now it seems to be all BlitzMAX.
These modifications to your test program shows that the average remains at 17 regardless of the number and height of the spikes
Also, I tried shutting down any backgroup tasks that I could. Now the spikes accur at around 55-60. I think the over 100 spikes were due to some process, but now it seems to be all BlitzMAX.
These modifications to your test program shows that the average remains at 17 regardless of the number and height of the spikes
'SetGraphicsDriver GLMax2DDriver() Graphics 800,600,32 'Graphics 800,600,0 Local t1:Int Local t2:Int Local test: Int Local high: Int Local lo:Int = 200 Const MAXVALUES=800 Local values:Int[MAXVALUES] Local counter=0 Local loops = 0 Local average = 0 Local total = 0 While Not KeyHit(KEY_ESCAPE) t1=MilliSecs() Cls DrawText "Current: "+test,0,0 DrawText "High: "+high,0,20 DrawText "Low: "+lo,0,40 DrawText "Average: "+average,0,60 DrawText "Press <Space> to reset High",0,80 DrawText "Press <Escape> to exit",0,100 ' DrawText GCMemAlloced(),0,80 For Local i=0 To MAXVALUES-2 SetColor 255,255,0 DrawLine 0,500,600,500 SetColor 255,255,255 DrawLine i,500-values[i],(i+1),500-values[i+1] Next Flip 1 t2 = MilliSecs() test:Int = (t2-t1) If test>high Then high = test If test<lo Then lo = test If KeyHit(KEY_SPACE) high = 0 lo = 200 loops = 0 average = 0 total = 0 End If values[counter] = test Counter:+1 If counter>=MAXVALUES Then counter = 0 loops :+ 1 total :+ test average = total/loops Wend