Hey Stephen, thanks that's great!! It should do what I need, I didn't think about it..
Dimitris
--- Στις Δευτ., 30/03/09, ο/η Stephen Sinclair
Από: Stephen Sinclair
Yo,
You can wait on the event itself, so that your loop
will wake up every
time a message comes in.
while( true ) { while( event.nextMsg() ) { event.getFloat() => f.pfreq; } 1::second => now; }
If you need to "do other stuff", I suggest doing this event loop in a shred by sporking it.
Sorry, I intended to change the code after copying it:
fun void msg_freq() { while( true ) { event => now; while( event.nextMsg() ) { event.getFloat() => f.pfreq; } } }
spork ~ msg_freq();
___________________________________________________________ Χρησιμοποιείτε Yahoo!; Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr