Allegro::Timer - Allegro Timer routines
use Allegro;
sub callback { $i++; }
$al = Allegro->new or die;
$timer = $al->Timer(code => \&callback,
interval => 0.10);
while($i > 0) {
print "timer was called\n";
$timer->poll;
}
Allegro::Timer provides an object-oriented interface to the Allegro timer related routines.
A timer object, after created will call its callback function at a certain interval until stopped.
Currently, Timers must be polled for the callback function to be called. A thread-based or SIGALRM-based Timer implementation may be included in the future. See poll below.
$timer = $al->Timer(code => \&callback,
interval => 1.0,
param => $param,
defer => 0);
Colin O'Leary <colin@mx3.org>
Copyright 2003 by Colin O'Leary. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The Allegro library is copyright its authors, and is giftware. See http://alleg.sf.net for more information.