I'm using the following code to calculate WPM (words/minute), CPM (chars/minute), CPS (chars/second) and Accuracy in a typing software.
//wpm
global.wpm = global.total_words / runtime_min;
//cpm
global.cpm = global.total_chars / runtime_min;
//cps
global.cps = global.total_chars / (runtime_min/60);
//accuracy
global.accuracy = 100 -((global.total_wrongChars*100)/global.total_chars);
Accuracy works, but the other spit out too high numbers, like 2843.1565 when it should be 1
You can make a custom variable at the create event
And increase it every step
Then you can use in your code like this