Skip to content

Typing Speed Tester β€” Time user input, calculate WPM + accuracyΒ #14

@ghostdeveloper404

Description

@ghostdeveloper404

🎯 Description

Build a simple program that measures how fast and accurately a user can type a given prompt.

  • Show a short text/snippet.
  • Time how long the user takes to type it.
  • Compute WPM (Words Per Minute) and accuracy (%).
  • Display a summary at the end.

πŸ“š What You’ll Practice

  • Input/output
  • Timing & basic math
  • String comparison
  • Functions & clean code
  • CLI user experience

βœ… Tasks

  • Create a new folder: your_name/typing_speed_tester/

  • Add main script: typing_speed_tester.py

  • Include a sample prompt in code (or load from prompts.txt)

  • Display the prompt clearly and start timing when user begins typing

  • Stop timing when user submits input (e.g., presses Enter)

  • Calculate:

    • Time taken (seconds)
    • WPM using: WPM = (characters_typed / 5) / minutes_elapsed
    • Accuracy (%) using: accuracy = (correct_chars / total_chars_typed) * 100
  • Print a neat summary with:

    • Prompt length (chars & words)
    • Time taken
    • WPM
    • Accuracy
  • Add README.md explaining:

    • What the project does
    • How to run it
    • Example input/output
  • (Optional) Add requirements.txt (if you use any libraries)

πŸ§ͺ Acceptance Criteria

  • Running python typing_speed_tester.py launches the tester in the terminal.
  • User sees a prompt, types their response, and gets time, WPM, and accuracy.
  • WPM and accuracy are calculated using the formulas above.
  • Code is organized into small functions (e.g., get_prompt(), measure_time(), calculate_metrics(), compare_text()).
  • README.md contains run instructions and a sample run.

🧩 Example (CLI flow)

Prompt:
"The quick brown fox jumps over the lazy dog."

Start typing and press Enter when done:
> The quick brown fox jumps over the lazy dog.

Time: 7.84s
WPM: 68.5
Accuracy: 100.0%

πŸ’‘ Hints

  • Use time.perf_counter() (Python) for precise timing.
  • Normalize strings before comparison (e.g., compare char-by-char; consider trimming trailing whitespace).
  • Decide how to handle backspaces/typos; simplest is to compare final typed string against the prompt.

πŸš€ Stretch Goals (Optional)

  • Live timer while typing
  • CPM (characters per minute) in addition to WPM
  • Per-word accuracy and highlight mistakes
  • Multiple prompts loaded from a file
  • Best score tracking via a local JSON file
  • Difficulty levels (short/medium/long prompts)
  • Colorful CLI output (e.g., Colorama)

🏷️ Labels

good first issue beginner-friendly help wanted

Need help getting started? Follow our First Contributions Guide or ask in Discussions πŸ’¬

Good luck and happy coding! πŸŽ‰


Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions