Simon's Blog

Introducing Tempus

September 18, 2020

Introduction

Time tracking can be a touchy subject, especially when it comes to Software Development. Often enough it is associated with either tracking time against an estimate of a task or time spent for billing purposes.

The former can cause undue stress and anxiety when a task is still ongoing yet the estimate has been exceeded. The latter can cause undue issues with clients disputing the amount of time that was actually spent.

Regardless of having experienced both of the above in the past and not being the biggest fan of time tracking, over the last year I have found myself tracking the number of hours that I worked in a given month in a Google Keep note.

The Process

Every day for the last 14+ months I have been taking down the time that I:

  • Started the workday
  • Stopped for my break
  • Stopped/Started for any reason (such as doing an errand mid-way through the work-day)
  • Completed the workday

At the end of every month I would manually calculate the actual number of hours I have worked so that I can adjust to work less/more hours in the next month. After having done this process manually for three times, my developer senses started tingling that this could be easily automated.

Productivity

Recently my role at $WORK has become more vague, causing me to spend a lot of time switching between different areas of concern depending on the priority assigned by the business. I prefer long uninterrupted streches of deep work (up to an hour or two), I find context switches very mentally taxing so this has been a learning experience for me on how to juggle several different contexts.

To this end, I wanted to start to keep track of context switches. This data will eventually lead to a better understanding of when most switches occur or what kind of tasks cause more switches than other.

To clarify, for me a context switch refers not to the type of task but rather the topic / feature being addressed. Switching from a chat over slack with a colleague, moving to a call with that same colleague whilst opening my code editor as we discuss and evaluate a new feature does not involve any context switches. If I am focusing on one area of our system and a colleague asks for a call about a different area, then a context switch occurs.

The Solution

The solution is Tempus. Tempus is my experimental time tracker, mainly aimed at software development and related workflows.

My requirements were simple:

  1. Be able to create a project
  2. Be able to create any kind of task for that project
  3. Be able to start and end a task within a project
  4. Be able to switch from one task to another, whilst also recording if I am making a context switch
  5. Aggregate task data within a project to understand my time investment better (how many hours have I spent today? How many times did I switch contexts?)

The Implementation

To build Tempus, I used the simplest tools I could think of that would allow me access from any device. It is a Web App which is fully server side generated (that is, no JavaScript or AJAX style API calls are involved). Creating Entry types, starting or stopping entries and recording context switches are simple HTML forms which perform POST requests. I used Go as a programming language and SQLite for data persistence, I upload and host the binary on a Digital Ocean VPS behind nginx as a reverse proxy, using letsencrypt for an SSL certificate.

To get an idea of the simplicity, here is a screenshot of tempus in its current state:

Tempus

The Future

The current iteration is simply for me to try out features as they begin to make sense or as I spot inefficiencies in my usage. One example I quickly spotted was that the project page lists all of the entries under each other (with no sort of filtering or pagination). After the first day of usage I had already clocked in twenty-five unique entries.

Since this list kept on growing, the buttons to choose a new entry type were getting pushed below the fold, which meant I needed to scroll down every time I wanted to switch tasks. To remedy this, I moved the buttons and the current task indicator above the list of entries.

I also see myself changing the front-end to a React-based Single Page Application. This would enable interactions such as a long press to indicate a task switch with a context switch, as well as make charts/analytics super simple to show on screen.

Given that Tempus is aimed primarily at Software Development workflows, it would also make sense to have an easy to use CLI, given that I spend more time living inside a terminal over the browser. Even if I were in a browser, I would need to find the relevant tab again, whilst a terminal is typically a hotkey away. I envisage it would have an API such as tempus start 'Programming' or tempus switch 'Documentation' --context-switch.

Conclusion

Worst case scenario, I learn that I do not need a time tracker or any time tracker could work. I also improve my Go and product development skills. Best case scenario, I create an awesome time tracker. I also improve my Go and product development skills.

Either way, win-win.

Tempus is open-source and is licensed under the MIT Licence. You can find the source code here on GitHub.


Written by Simon who lives in Malta. You can find out more about me on the about page, or get in contact.