Arbtt is automatic, rule-based time tracker. And I like it because it is implemented in Haskell.

I wanted to know how much time have I wasted watching YouTube videos.

Is watching YouTube videos the purpose of human life?

I define productivity as the ratio between the time spent consuming information and the time spent producing something:

Time spent for the production of something valuable
Productivity = ------------------------------------------------
Time spent for consumption of information

Further generalization of the above:

Productivity = ------------

If I consume less I will be more productive. Consuming less information will give me the freedom of time.

Time frugality brings contentment

How to save time using time tracking software? I use Arbtt to track and analyze time spent in front of a computer.

I create Arbbt rules to track time spent reading news, watching YouTube, etc. The rules are in the ~/.arbtt/categorize.cfg file:

current window $title =~ m!Tiny RSS!
==> tag News:TinyRSS,
current window $title =~ m!YouTube!
==> tag News:YouTube,
current window $title =~ m!Gmail!
==> tag Email:Gmail,

What percentage of the time am I actually being productive (coding)?

current window ($program == "emacs")
==> tag Productive-time,