Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 1.64 KB

README.md

File metadata and controls

27 lines (15 loc) · 1.64 KB

Pomodoro Timer

Command line Pomodoro timer to keep you productive!

This mini project was created in 2021 with the purpose of practising coding in Golang.

Background

The Pomodoro Technique is a time management system whereby work sessions are broken into 25-minute chunks separated by 5-minute breaks. These intervals are referred to as pomodoros.

After 3 pomodoros have been completed, the break after the next pomodoro will be 15-minutes. The completion of this full cycle of 4 pomodoros is considered 1 cycle.

Implementation Details

This Pomodoro timer displays the countdown timer on the terminal, using the return carriage to overwrite the previous time. An alarm will play at the end of each session and users can press the Enter key to stop the timer and begin the next session. Ctrl-C is used to stop the Pomodoro timer. Upon stopping the timer, a summary line will be printed to inform users of the number of completed cycles.

The following points are key details in the implementation of the timer:

  • A ticker was used to display the change of the countdown timer on the terminal every second.
  • A timer was used to indicate the end of each period.
  • The beep package was used to play the alarm sounds.

Known Issues

As the Enter key is used to stop the alarm, there is a need to flsuh the input buffer before playing the alarm and listening for the \n character.

Currently, the program handles this by using cgo. This method was inspired by the solution posted here. However, this method only works on Unix systems and not on Windows.