So, you type `git pshu<enter>` and realise you made a typo before you've finished typing. You can't react fast enough to stop hitting enter but you can absolutely ctrl+c before 100 more ms are up
So, you type `git pshu<enter>` and realise you made a typo before you've finished typing. You can't react fast enough to stop hitting enter but you can absolutely ctrl+c before 100 more ms are up
Similar to the other reply, I also commonly do that when typing, where I know I've fat fingered a word, exclusively from the feeling of the keyboard.
But also, your not just trying to beat the fork/exec. You can also successfully beat any number of things. The pre-commit hook, the DNS look up, the TLS handshake. adding an additional 100ms of latency to that could easily be the difference between preempting some action, interrupting it or noticing after it was completed.
I wrote this bash script:
#!/usr/bin/env bash
start_time=$(gdate +%s%3N)
# Function to handle Ctrl+C (SIGINT)
on_ctrl_c() {
end_time=$(gdate +%s%3N)
total_ms=$((end_time - start_time))
# Calculate integer seconds and the remaining milliseconds
seconds=$((total_ms / 1000))
millis=$((total_ms % 1000))
# Print the runtime in seconds.milliseconds
echo "Script ran for ${seconds}.$(printf '%03d' ${millis}) seconds."
exit 0
}
# Trap Ctrl+C (SIGINT) and call on_ctrl_c
trap on_ctrl_c INT
# Keep the script running indefinitely
while true; do
sleep 1
done
And then i typed "bash sleep.sh git push origin master<enter><ctrl+C>"and got "Script ran for 0.064 seconds."
I'm not a competitive speed typist or anything but I struggle to get above 110 on a standard keyboard and I don't think I've ever seen anyone above the 125-130 range.
[0] https://www.typingpal.com/en/documentation/school-edition/pe...
Not gonna believe that without empirical evidence.
Regarding reaction time, below 120ms (on a computer, in a browser(!)) is consistently achievable, e.g. this random yt video https://youtu.be/EH0Kh7WQM7w?t=45 .
For some reason, I can't find more official reaction time measurements (by scientists, on world champion athletes, e-athletes), which is surprising.
> So it is not a reaction time, but an enter to ctrl+c scenario.
At minimum, if we ignore the whole "changing your mind" thing. And for comparison: the world record for typing speed (over 15 seconds and without using any modifier keys) is around 300wpm, which translates to one keypress every 40ms - you really think 100ms to press two keys is something "you can absolutely" do? I'd believe that some* people could sometimes do it, but certainly not just anyone.
The delay is intended to let you abort execution of an autocorrected command, but without reading the output you have no idea how the typos were corrected.