From 82ae93575490c954d9dc5b23c8b27f736cc7643a Mon Sep 17 00:00:00 2001 From: Gauransh Kumar <33760112+gauranshkumar@users.noreply.github.com> Date: Sat, 17 Oct 2020 18:33:28 +0530 Subject: [PATCH] Converted CPM to WPM Used WPM as measure rather than CPM --- src/extension.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index c30dd8e..877857b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -29,13 +29,15 @@ class TypingSpeed { this._keystrokes.add(now); let cpm = 0; + let wpm = 0; const count = this._keystrokes.size(); if (count > 1) { const firstTime = this._keystrokes.first(); cpm = count * 60000 / (now - firstTime); + wpm = cpm / 5; } - this._statusBarItem.text = `$(keyboard) ${cpm.toFixed(1)} cpm`; + this._statusBarItem.text = `$(keyboard) ${wpm.toFixed(1)} wpm`; this._statusBarItem.show(); }