## Clocking your time in org-mode

| categories: org-mode | tags: | View Comments

I have some need for tracking how much time I spend on certain jobs, e.g. committees, etc… because 1) I have to report this information, 2) I need a better idea of how much time some things take. Org-mode supports the idea of "clocking in to a task". You run (org-clock-in) in a heading, and it stores a time stamp. You do your work in that heading, and when done, you (org-clock-out).

You can summarize your time with (org-clock-report) which puts a dynamic block in your file like this.

Table 1: Clock summary at [2014-01-26 Sun 13:36]
Total time 0:24
Clocking your time in org-mode 0:24
\__ Using clocking effectively   0:05

You can update it by putting your cursor in the #+BEGIN line, and pressing C-c C-c.

It seems that the clock-in mechanism works on the heading you are in. So whenever you clock in, it is specific to that heading. If you clock-in more than once, multiple CLOCK entries are stored, unless you modify org-clock-into-drawer. It seems like you probably want these CLOCK entries in a drawer, so you should put this in your init.el file:

(setq org-clock-into-drawer t)


## 2 Clock in to the right task

By default, (org-clock-in) creates clocks-in to the current headline. Org-mode seems to store a list of recently clocked tasks. You can access them by typing C-u C-c C-x C-i. You will be given some choices of which task to clock in to. You can switch to another task by doing this too.

## 3 Using clocking effectively

It will take some discipline and practice to use this effectively. It appears you can clock in any heading, and then use the clock report to aggregate all the times into one summary. That report can have a variety of scopes, from subtree to file. In that case, if you keep all relevant task information to a project in a file, you just clock in wherever you work in that file, and let the report keep track of it for you.

You could use this to track the amount of time you spend reviewing manuscripts, or doing work for a committee. You just need to remember to actually use it!

It might be interesting to setup code that would automatically clock in when you open a file, and then clock out when you close it. Probably this would be done with hooks.

There is a nice map of using org-mode for clocking time here .