How fast can you type the alphabet?

I was looking through a bunch of archived Lounge topics from 2010, and I found this one, which I thought was kind of interesting. I pasted the code into TextMate, saved it, and it compiled just fine when I linked with -lncurses.

https://www.cplusplus.com/forum/beginner/28855/3/#msg159698

My best time was 0:07:35. But then I don't do a lot of typing other than C++, which only requires random words and weird punctuation. I could probably write an entire Hello World program in about 10 seconds...

I know this is going to turn into just people posting their times (and people who get 0:00:25 times because they cheat and paste the alphabet in), but it was interesting digging this up.
My typing speed depends on several factors, not excluding whether my arthritis is being particularly bothersome at the moment.

I am less concerned with being a speed demon, I prefer to be as accurate as I can be.

Most times I blurp a bunch of characters in rapid succession as my brain squeals and squishes my thoughts for what I am doing.

Coding speed is definitely at a lower magnitude than composing missives like this.
0:04.43 (5.87 letters per second)
Running it on cpp.sh always gives 0:00.00 as the output.

Once I ran it on VS I got an ok time on my first try:

It took you 0:04.96. Good job!



However, there's something wrong with the program. What I thought would be my best time ended up being:

It took you 0:10.60. Good job!


It took me a few seconds to start typing, and it seems to have counted them. A little testing showed that about 3 out of 5 times, the timer starts as soon as the program runs.


Anyway, this was the best time I got after about 10 minutes of tinkering around with the program:

It took you 0:03.98. Good job!
Running it on cpp.sh always gives 0:00.00 as the output

Apparently something to do with the interface between the browser and the computer running the program.
It actually gives a very small time if you increase the precision, but the getline executes pretty much instantly.
It seems that on cpp.sh the program never sees input except in whole lines.

A little testing showed that about 3 out of 5 times, the timer starts as soon as the program runs.

I can't get it to screw up like that. I'm running on linux, so if you're on Windows that could be the difference there. I imagine that only happens if you mistype the alphabet and then retype it without exiting and restarting the program.

Who         Seconds    L/S
zapshe      0:03.98    6.53
dutch       0:04.43    5.87
agent max   0:07.35    3.54

Last edited on
That explains that.

Yea, I'm running it on Windows. I tested that it starts the timer early by running the program, waiting a couple seconds, then pressing enter. It would say I typed the alphabet wrong and all, but about 3 out of 5 times the timer had several seconds on it instead of just 0.

That issue doesn't exist after the first attempt though. When it gives you another try, the timer never started early.
Sorry to raise a (month) old topic, but figured some explanation about timing issues was in order.

There are a number of reasons the timing could fail.

The compiler is allowed to reorder operations that do not affect each other. This is a well-known problem with timing code snippets. (The code uses OS facilities to reduce the likelihood of that occurring, but not guaranteed, alas.)

The underlying hardware can reorder stuff too! In fact, it can execute things in ways you wouldn't expect. If you google around "pipeline branching/ordering" and the like you can read some weird stuff about how the processor optimizes execution time, and how it can goober some time-sensitive code constructs...

C++ does not directly address these issues as of C++17.

The next problem has to do with input processing. Again, C++ leaves a lot of that to the underlying OS. The code begins timing when input is detected, which may not be exactly what the code intends.

You see this most clearly when running the program through a browser... the server running the code does not receive input until after the user has hit the enter key... which is when the client (your browser) sends the entire string back to the server, giving a cut-n-paste entry time of some microseconds.

Likewise, it is possible that the terminal has sent non-user-input data which you don't see yet still activates the timer and starts the getline() input loop, all before you have pressed a key.

Hope this helps explain some of the weirdness.

Remember, user input is the most evil of all programming problems. Heh...
Remember, user input is the most evil of all programming problems. Heh...


Yeah - using standard C/C++ input!
Remember, user input is the most evil of all programming problems. Heh...

I'd argue that is only 2nd. The mostest and ultimate evil is The User.
Well yes, users are a problem. Everything would work much better if there weren't any...
Who's the fastest alphabet typist is as world-wide consequential as who's the fastest Rubic's Cube solver.

Nations will rise and fall on who that is. *roll eyes*
@Duthomhas Welcome to the land of the living! Thanks for the explanation, that makes a lot of sense :)

Who's the fastest alphabet typist is as world-wide consequential as who's the fastest Rubic's Cube solver.

Plenty of real world applications for fast typing. Like people who are expected to type as fast as someone talks.

However, in this case, its just a little friendly competition.
The truth is:

The faster I type the more I have to press backspace :)

I prefer not to type too fast because it takes thinking about what you type as well, and if you don't think too fast that means your "typing pauses" will be visible more often which makes a bad feeling too.
The faster I type the more I have to press backspace :)

It happens, that's why I like things like Microsoft Word, because it just fixes those minor spelling errors and I don't have to go back and fix them myself.

And I tend to let the words just flow out instead of having to think about each word I type out.
that's why I like things like Microsoft Word, because it just fixes those minor spelling errors


Aha! does that work with intellisense? (joke lol)
Lol, well I don't tend to misspell when coding. I don't type as fast when coding as when doing something like writing an essay, unless I have the whole program in my head already.
I mistype all the time when writing code no matter the speed of typing.

Well, a goodly number of those mistypes are a result of slower than whale snot code completion selecting the wrong feature instead of the one I want.
@Furry Guy

Had no problems with anything being slow, maybe its time to upgrade? Speaking of which, I got VS2022 last night and it works like a charm. Doesn't seem to have the crashing issues I was having with 2019.
I got VS2022 last night

Awesome, thanks for saying, installing tomorrow...

according to download page sounds like must install
https://visualstudio.microsoft.com/vs/preview/vs2022/
malibor wrote:
The faster I type the more I have to press backspace :)
I prefer not to type too fast because it takes thinking about what you type as well, and if you don't think too fast that means your "typing pauses" will be visible more often which makes a bad feeling too.

Agreed. My project team takes turns writing the monthly report, and every Tuesday (a certain co-worker's day), our group manager would chew us out for writing a terrible report. So I eventually got delegated the job of writing reports, since mine apparently were the best. (Not a complaint, mind you, I like writing reports, especially with too much technical language in them).

Duthomhas wrote:
Remember, user input is the most evil of all programming problems. Heh...

For sure. Right up there with trying to use dynamic memory allocation and forgetting your delete...
Registered users can post here. Sign in or register to post.