Introduction
I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like yellowwooddoor has a ton of repeated letters, it takes a bit longer to type it. Even worse is when a word like "jump" has the same finger used for multiple different consecutive letters.
Here's how long it takes me to type letters on each finger (very unscientifically measured):
Columns are Finger name, keystrokes/second, seconds/keystroke, and the keys used by each finger
Typing same letter twice:
L Pinky 5.2 0.1923076923 1qaz
L Ring 5 0.2 2wsx
L Mid 5.3 0.1886792453 3edc
L Index 5.5 0.1818181818 4rfv5tgb
R Thumb 6.5 0.1538461538 [space]
R Index 6.9 0.1449275362 6yhn7ujm
R Mid 6.3 0.1587301587 8ik,
R Ring 6.2 0.1612903226 9ol.
R Pinky 6.1 0.1639344262 0p;'
Typing different letter on same finger:
L Pinky 4.6 0.2173913043
L Ring 4.6 0.2173913043
L Mid 4.5 0.2222222222
L Index 5.3 0.1886792453
R Index 5.4 0.1851851852
R Mid 5.1 0.1960784314
R Ring 5.2 0.1923076923
R Pinky 5.2 0.1923076923
Same data in CSV format.
It takes
.75 * (first_finger_same_letter_time + second_finger_same_letter_time) / 2
time to switch between two fingers.
Challenge
Given a string as input, how long does it take to type it?
- The "timer" starts the moment the first key is pressed and ends when the last key is pressed. You are just counting the time between keypresses.
- This is code-golf. Shortest answer in bytes wins.
- Submission can be either a complete program or function.
- Input and output any way you want it, stdin/out, function params, file, doesn't matter.
- Output should be accurate to at least 3 decimal places (+/- 0.001 for rounding error is fine). Leading 0. for numbers under 1 and trailing newline optional.
- Input will be a string that contains (lowercase) a-z, 0-9, space, semicolon, comma, period, and apostrophe.
- I always type spaces with my right thumb.
- I use the normal touch typing fingers (you can also look at the above table for finger-key mappings).
- Reference code used to generate test cases
Test cases
(empty string or any one-character string) - 0.000
aa
- 0.192
fff
- 0.364
fj
- 0.123
the quick brown fox jumped over the lazy dog
- 5.795
yellowwooddoor
- 1.983
orangewooddoor
- 1.841
jump on it, jump on it
- 2.748
type on it, type on it
- 2.549
abcdefghijklmnopqrstuvwxyz01234567890 ;,.'
- 5.746
ok, this may not be the most accurate but it's in the ballpark, maybe within 30 percent or so.
- 12.138
0
if the input is empty or a single character? \$\endgroup\$