TaskTimer: A programmer's/hacker's/hobbyist's time management "egg timer" Written by Jim Leonard, trixter@oldskool.org, May 2001 Last modified 04/26/2006 Released as Freeware. You may copy, modify, republish, etc. as long as "Jim Leonard" or "trixter@oldskool.org" is noted as the original author. Introduction: TaskTimer is a program that helps over-applied computer freaks and other obsessed workaholics manage their computing time effectively between projects. It achieves this by acting as a multiple-stage, configurable, controllable "egg timer", constantly reminding you of the tasks you have to complete and how much time is left for each task. Too many times, I have sat down at night when the wife and kids are in bed and essentially wasted my time. (By "waste", I mean getting distracted reading web pages, playing a game for too long, and so on instead of applying my time effectively to the various projects that I am trying to juggle.) Plus, I always feel like I have no time to just plain RELAX with a computer game now and then. This leads to frustration as I go to bed not having accomplished anything, not having relaxed, and not having used my time effectively. TaskTimer fixes this. It's basically an egg timer that serves as both a priority list and a realtime controllable "nag" that I use to remind myself what I should be working on and for how long. It works by displaying a task and a countdown, then beeping when the time for that task has elapsed (an alarm) and then displaying the new task. Tasks can also be paused, or skipped entirely. By including *all* of the things I want do on the computer, from answering email to fixing PCs to programming to playing games, I can go to bed knowing that I've used my time as effectively as possible -- that every task got a slice of my computing time. In other words: If you've spread yourself too thin and can't manage your time effectively, this is the program for you. Configuration: (Note: The "/a" switch makes it easy to configure TaskTimer by walking you through the options, but it's still a good idea to read this section so you know what all of the options mean, what their intended function is, etc.) TaskTimer is configured by reading an input text file called tasks.ini (although you can override this by providing an alternate filename as an argument on the command-line). This contains the following information seperated by a delimiter, currently a pipe symbol: Name|Days|MinMinutes|MaxMinutes|Pauseable|Skippable|Deferrable|Comment ...where: Name (string) : The name of the task you're trying to complete Days (see below) : The day(s) this task is supposed to run MinMinutes (number) : Minimum number of minutes you want to spend on this task MaxMinutes (number) : Maximum number of minutes you can spend on this task (useful for limiting game playing) Pauseable (boolean) : Whether or not this task can be paused (you have to go to the bathroom, the phone rings, etc.) Skippable (boolean) : Whether or not this task can be skipped (set this to "no" for important things, set it to "yes" for unimportant things like games) Deferrable (boolean) : Whether or not this task can be deferred (you want to work on it, just not right now) Comment (string) : An optional longform comment. The order of the items in the configuration file determines their display priority (the program iterates through them one at a time in file order). So the first item in the text file is the most important task, the second item is the next most important, etc. The "days" field is a bitwise sum of what day or days you want a task to execute. The values for each day are as follows: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday = 8 Thursday = 16 Friday = 32 Saturday = 64 Telling TaskTimer which days to run a particular task is as easy as adding up the days' values and inputting the final number into the Days field in your tasks.ini file. For example: Monday only: 2 Tuesday and Thursday only: 4+16 = 20 Monday through Friday: 2+4+8+16+32 = 62 Saturday and Sunday only: 64+1 = 65 All days of the week: 1+2+4+8+16+32+64 = 127 No days of the week (do not execute): 0 This can be a bit confusing, I know, so just look at the included TASKS.INI sample file and it should become clearer. If the tasks aren't valid for days that you think they should be, run TaskTimer with the "/c" switch -- it will print out all tasks in the file along with the days they are valid for. Better yet, just use the "/a" switch to add tasks to the file so you don't have to do the math :-) Operation: Once the configuration file is loaded, TaskTimer starts displaying the first task with a diminishing countdown (the "egg timer" portion). You are now supposed to work on the displayed task. When you're out of time for the current task, the computer will beep once a second (a crude alarm) until you hit spacebar, then it will display the next task. Rinse and repeat. Lots of information is displayed during a countdown, including time left remaining for the current task, time already spent on this task (the flipside of the above), minimum/maximum time remaining/required for all remaining tasks, time remaining that can be used to extend the current task (if permitted by the config file), and so on. Actions you can take (if permitted for that task) while the timer is running include: (P)ause the current task. This pauses the timer (in case you have to go to the bathroom, the phone rings, etc.). Acts as a toggle; hit (P) again to unpause. (S)kips the current task. This marks the current task as "completed" and moves to the next one (in case you've already completed that task, or finish it prematurely). (D)efer the task until later. This temporarily skips the current task and moves to the next one (in case you can't work on the current task immediately, or just want to work on something else right now). (E)xtend the current task. This adds 1 minute to the current task's time remaining (in case you're almost done with the task and just need some more time). You can (E)xtend a task as much as you like up until the maximum time allowed for that task. Note: To mark a task as extendable, MinMinutes must be less than MaxMinutes. The program exits when the last task's time has elapsed. Some info is printed out after the program exits, including: - Total time since tasktimer was started - Total time spent performing tasks - Total time wasted (time since started minus time spent performing tasks) Planning Notes: Some notes on configuring tasks for the computer person (hacker/phreak/programmer/webadmin/gamer/hobbyist): First, before you add any tasks, you should sit down and think for a bit about everything you are involved in, what you want to accomplish, and how long you want to work on it. A few minutes of planning can save you frustration later if you need to edit the config file (which, although easily understood, can still be irritating). Here are the design intentions of each task property: Pausable: Most tasks you configure should be pausable in case nature calls and you need to go to the bathroom, the phone rings, your kids need you for something, etc. The only types of tasks that probably should explicitly *not* be pausable are game playing. We all need to play games to relax, but it's not as important as other tasks in the grand scheme of things, so you shouldn't penalize your other tasks by pausing a game for 15 minutes or more and reducing your overall time available for those tasks. It's a game -- you snooze, you lose. Skippable: This should NOT be set for most tasks; otherwise, there will be no motivation to actually do them! About the only types of tasks I can think of that should be skippable would be games (in case you're running out of time for other tasks) and maybe exercise if you've injured yourself the previous day and can't move without pain. Deferrable: Most tasks should be marked as Deferrable. The really important things you need to do, or the things you need to do early in your computing time, should probably *not* be deferrable, like exercise. Extendable: Most tasks should be configured as Extendable (by making sure that MinMinutes is less than MaxMinutes). About the only tasks that should *not* be configured as extendable are tasks that you need to do each day but that you tend to spent too much time on (like relaxing and playing games). Also, try not to configure any task's MaxMinutes more than 90 or 120 minutes long -- if you need to spend that much time on a task, you probably need to spend *all* your time on that task and don't need a multi-task egg timer :-) Known issues: - The program does not handle day-of-the-week switches gracefully while the program is running. In fact, it does not handle them at all. So don't expect your tasks to switch at the stroke of midnight, because they won't. - The code is fugly. QUITE fugly. I wrote it with the intention of optimizing for compiled binary size, which traditionally has the tradeoff of being very messy. Unfortunately, the binary is nearly 20K so I failed on all counts :-) In the future, as a disciplinary exercise, I plan on converting it to object-oriented code. I also plan to use memory-friendly techniques like linked lists instead of a fixed array; this will undoubtedly cut down on memory usage, but all the single-line functions and procedures used to implement methods are probably going to increase the compiled binary size. (But at least it will be readable!) - While you can easily add new tasks with the "/a" command-line switch, there is currently no "task editor". Until I create one, edit tasks.ini with a text editor. - Using days of the week requires that your system date be set properly. For those using old computers with a non-functional clock battery, put "date" in your AUTOEXEC.BAT file so you can get into the habit of setting it! - Requires color hardware (CGA and all others=YES, Hercules/MDA=NO). I am too lazy to assemble an oldskool machine with Hercules/MDA for the sole purpose of testing this program on it, and there's no point in me coding the support for it if I can't test it. If you really need this, email me and I'll do it. - This has been tested on a 4.77MHz 8088 PC/XT and found to work fine. A PCjr is, if you can believe this, slower than a PC/XT. I have not tested it on my PCjr yet. Caveat PCjr Emptor. Background: I wrote 99% of this documentation before I wrote even one line of code. Writing a program specification *before* you start writing the program helps to keep your shit together during the coding process. I wrote this program because I was tired of going to bed feeling like I got nothing done. I cannot manage my time well, and thanks to TaskTimer, I don't have to any more. While it should work in any MS-DOS window in Windows/DOSBOX/whatever, the target platform for TaskTimer is any PC, from 1981 onward. I need to reboot occaisionally when I do my work, so I couldn't run TaskTimer on my work machines... but due to the nature of my hobbies, I have a lot of old machines lying around. So I wrote it for a 4.77MHz 8088, which is where it runs when I'm not playing an old game, pirating old software, etc. TaskTimer is also great for HP LX palmtops, or any other handheld that can run MS-DOS programs. This program can be improved. For example, it screams to be rewritten as an object-oriented program. If you restructure it as an OOP, I would love to see your revisions. I'm also curious if proper restructuring would have any effect on codesize. Contact info: As always, I can be contacted at trixter@oldskool.org.