Calculate typing speed. How?

khmerguy

New member
Joined
Mar 25, 2007
Messages
2
Programming Experience
Beginner
Hi all, m new here. M creating a small typing program for my language. Everything is ok but i have a problem that i don't know how to write code to calculate typing speed.:(

Could anyone show me how to do it?

Thanks.:)
 
Decide when to start timing and save Date.Now in a Date variable. Decide when to calculate typing speed, for example by clicking a button. Divide textbox123.length which is the number of characters with the time span in choosen interval (seconds or minutes or other). To get the time span you subtract the saved time from current Date.Now. Now you have calculated for example "average chars per minute" and display the result in a label.
 
Thank JohnH. For this help. Could you please write in code? coz m new to .net, so m not clear for some command or syntax.
 
VB.NET:
    Private starttime As Date

    Private Sub StartButton_Click(ByVal sender As Object, ByVal e As EventArgs) _
    Handles StartButton.Click
        starttime = Date.Now
    End Sub

    Private Sub StopButton_Click(ByVal sender As Object, ByVal e As EventArgs) _
    Handles StopButton.Click
        Dim ts As TimeSpan = Date.Now.Subtract(starttime)
        Dim charcount As Integer = InputTextBox.Text.Length
        Dim charspersec As Integer = charcount \ ts.TotalSeconds
        InfoLabel.Text = "Chars/sec: " & charspersec.ToString
    End Sub
 
Who ever heard of expressing typing speeds in characters per minute. Every typist I've ever employed has words per minute on his/her resume, charcters per minute would be meaningless.
 
I strongly disagree, no counting make sense unless you compare results, and the only requirement is that the results is comparable. To prove this you and me are going to have a typing contest of your flavour "words/min", where you are going to write the word "Neuropsychological" 100 times and I will write the word "I" 100 times. By the end of the test we will both have written 100 words, and I win.

Such typing tests usually have a control text that the testee have to type. This give a unique benchmark comparison between test subjects, it also ensures that some idiot doesn't sit there hammering the keyboard with nonsense characters ("asdhfaskdjf"). As said it doesn't matter if words or characters are measured, but characters is a better common denominator between different texts than "words". Words are meaningless.
 
Back
Top