sort them into a queue in ascending order by time
pop next from the queue
set a timer to expire at the time of the event you popped
wait for the timer
when the timer goes off, play the event
repeat till the queue is empty
 
something like this should work assuming you have a timer
available with resolution finer than your event granularity
 
 
 
 
 
----- Original Message -----
Sent: Tuesday, February 04, 2003 08:29
Subject: [DUG]: [Q] Looking for suggestions....

G'Day,

I have a list of "events". Eg:

13:12:23.165 Event A
13:12:25.215 Event B
13:13:02.165 Event C
13:13:05.471 Event D

I need to "replay" these events with the same time interval. I was looking for some approaches to do this:

Approach 1:

- Read all events into a memory structure
- Poll the structure every x mileseconds and process the events that need to be "done"

This seems rather inelegant. Has someone got a better idea or two?

TIA

-- Donovan
----------------------------------------------------------------------
Donovan J. Edye [
www.edye.wattle.id.au]
Namadgi Systems [
www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': "...Uh Oh...."
----------------------------------------------------------------------
GXExplorer [
http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
----------------------------------------------------------------------

Reply via email to