08 December 2018, 00:08 | #1 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
Measuring time/frames
I'm trying to check wether I get everything done inside the duration of a frame (ie, in a 50th of a second). Assuming I had a way of measuring time sufficiently accurately, I could measure the time before I 'do my stuff', and then again at the end. Within each frame, I mean.
This is for application in a demo, so the measuring would preferably have as small an influence as possible. I'm using Photon's frame loop, btw, so this is what it would look like: Code:
;-- main loop start mainLoop: waitFrame1: btst.b #0,$dff005 bne.s waitFrame1 cmp.b #$2a,VHPOSR bne.s waitFrame1 waitFrame2: cmp.b #$2a,VHPOSR beq.s waitFrame2 ;-- frame loop start ;TODO: timeStart = current time ;do my stuff ;TODO: timeStop = current time ;TODO: duration = timeStop - timeStart ;TODO: assert that duration < 20 milliseconds ;-- frame loop end ;-- main loop end btst #CIAB_GAMEPORT0,CIAAPRA ;LMB pressed? bne.b mainLoop So anyway, does anybody have any other thoughts on how to go about this? |
08 December 2018, 04:49 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,062
|
Code:
waitFrame1: move.w #$0f0,$dff180 ; new ... beq.s waitFrame2 move.w #$000,$dff180 ; new |
08 December 2018, 11:07 | #3 |
Registered User
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying to measuring the CPU cycles/instr ! (A500) | amilo3438 | Coders. Asm / Hardware | 20 | 31 August 2017 20:22 |
measuring in layout - lightwave | source | support.Apps | 7 | 25 June 2016 00:20 |
Measuring/comparing display latency | mark_k | support.WinUAE | 2 | 02 March 2016 16:15 |
Measuring speed with pixels | Lonewolf10 | Coders. General | 19 | 18 November 2011 09:31 |
Frames | Twistin'Ghost | HOL data problems | 16 | 20 September 2003 10:26 |
|
|