NAME ^

SDL::StopWatch - A stopwatch using SDL::LCD

SYNOPSIS ^

    # create the stopwatch
    $I0 = find_type 'SDL::StopWatch'
    watch = new $I0, screen
    
    # set its position
    watch.'xpos'( 5 )
    watch.'ypos'( 5 )

    # start it
    watch.'start'()

DESCRIPTION ^

You can start, stop and reset this stopwatch. You do not need to draw it while it is running, this is done by an internal timer.

METHODS ^

An SDL::StopWatch object has the following methods:

__init( screen )

Creates a StopWatch object.

The stopwatch will be drawn onto the specified screen.

reset()

Resets the stopwatch.

start()

Starts the stopwatch.

stop()

Stops the stopwatch.

current_time()

Returns the measured time, multiplied by the reciprocal of the precision value.

draw()

Updates the stopwatch and draws it.

It is drawn onto the screen consigned to the constructor.

AUTHOR ^

Jens Rieks <parrot at jensbeimsurfen dot de> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.

COPYRIGHT ^

Copyright (c) 2004, The Perl Foundation.


parrot