in reply to How fast do I type?
The standard method for calculating words for the purpose of finding WPM is counting all the characters and dividing by six. Why six? Because the average word is 5 characters long, plus a space.
I'm really no good at one-liners or golfing, but I quickly modified your code. It obtains the accuracy you're looking for. Tested on ActivePerl Build 629 (Perl v5.6.1).
#!perl $x=time; $letters=scalar(split//,<>)/6; print $letters/(time-$x)*60;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: How fast do I type?
by foogod (Friar) on Sep 10, 2001 at 23:37 UTC | |
by jeffa (Bishop) on Sep 11, 2001 at 04:16 UTC | |
by mischief (Hermit) on Sep 12, 2001 at 15:33 UTC | |
by foogod (Friar) on Sep 11, 2001 at 05:54 UTC |