in reply to Running in 'RealTime'

Sihal is absolutly right. I read the bit about Chess and thought the op wanted a elapse time clock like used in chess clocks.

An No alternative to forking is to use Term::ReadKey.

#! perl -sw use strict; use Term::ReadKey; use Time::HiRes qw(gettimeofday tv_interval usleep); my $start = [gettimeofday]; usleep 10_000, printf "\r%6.2f Press Enter when ready", tv_interval $start while !defined ReadKey(-1); print $/, 'You took ', tv_interval($start), ' seconds to hit the Enter + key', $/; __DATA__ # Ouput C:\test>203582 7.33 Press Enter when ready You took 7.331 seconds to hit the Enter key C:\test>

Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!

Replies are listed 'Best First'.
Re: Re: Running in 'RealTime'
by Sihal (Pilgrim) on Oct 08, 2002 at 14:28 UTC
    Hum, I don't think this answers correctly to the problem... However the first solution might work, but isn't there any other way, apart from forking?