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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Running in 'RealTime'
by Sihal (Pilgrim) on Oct 08, 2002 at 14:28 UTC |