Skip to content

js216/timetree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timetree

Timetree is an interactive program to keep track of time spent on tasks and subtasks and subsubtasks and so up, up to MAX_TREE_DEPTH defined in timetree.h.

Building

The program is entirely self contained and only needs make and a C compiler:

$ cd timetree
$ make

Usage

The program takes one command-line argument, which is taken as the name of the log file:

$ ./timetree log.txt

Following this command, the interactive session is started. Two commands are used: [ to open a task, and ] to close it. The ] command takes an optional string argument, to give the task a name. A newline terminates the command line, which is thereupon appended to the log file together with a timestamp. When the last open bracket is closed, the program will print out a session summary.

In the following timetree session, the indentation is supplied by the program, while the user typed all the visible characters:

[
   [t1
      ]
   [t2
      [t2.1
         ]
      ]
   [t3
      ]
   ]

When the last closing bracket is typed, the program will print a session summary showing the individual task durations:

2025-07-11 17:02:49
=======================
00:00:02 (empty)
00:00:00 ├── t1
00:00:01 ├── t2
00:00:01 │   └── t2.1
00:00:01 └── t3

The log file will contain the timestamps and the typed info:

1752278569 [
1752278570 [t1
1752278570 ]
1752278571 [t2
1752278574 [t2.1
1752278575 ]
1752278575 ]
1752278577 [t3
1752278578 ]
1752278579 ]

If only a closing bracket is typed in the entire session, then timetree will print all sessions, and an overall summary at the end.

License

Copyright 2025 Jakob Kastelic

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

A program to keep track of nested tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors