Tag Archives: time

clockwork: Easier to fudge

I’ve seen a few work time trackers for the console, but nothing recently. I spotted clockwork on a list that I was skimming and thought maybe it deserved a closer look.

clockwork is just a bash script that marks time and can generate simple reports. I hold that in a decent measure of esteem, since most of my own bash scripts are about three lines long and spew forth “Hello, world!” if I’m lucky.

2015-03-03-6m47421-clockwork.sh

A few things that make clockwork seem to stand out: It can apparently keep track of “sick days” by allowing you to feed it days you are in debt to The Man. I don’t see that it can break a day down into hours in debt, but I would guess most people don’t track “in debt” hours like that.

clockwork can also tell you how much longer you have to stay at work, and can generate a report suitable for relaying to whomever signs your checks.

clockwork also allows you to “punch in” late or “punch out” early, which might be too much of a temptation for some folks. It does make clockwork fairly easy to fudge.

As a side note, I did notice that clockwork seems to make a few assumptions, most noticeable being the caveat about an 8 1/2-hour day, and a 42 1/2-hour work week. I am familiar with that calculation, but I’ve also been in countries where eight hours was a day, and 40 a week. That seems like it might vary with culture or geography.

Not in Arch/AUR, not in Debian. And would be a trifling to package for either system, if you want an easy one to work with. 😉

tty-clock: Taken for granted, for far too long

I casually mentioned tty-clock the other day while traipsing through ncurses-examples, then thought for a half a second and worried that I had never included it here.

A few panicked searches later and my fears were confirmed: Out of all the thousands (and yes, it has been thousands) of programs I’ve looked over in the past 20 months, I never gave proper attention to tty-clock.

That’s something we shall have to remedy.

2014-09-07-6m47421-tty-clock

I can’t think of a system I’ve built in the past five years that hasn’t included tty-clock. I’ve even patched it myself, a long time ago, before it was possible to feed a date format into the display.

tty-clock is usually what I hold up to other console clocks, and see how the fare. If a text-only clock can pass muster with tty-clock, it’s doing pretty well.

You can poke around with it on your own time, but know that it can handle multiple colors now, as well as bold effects, flashing time separators, seconds display, rebounding through the terminal window, 24-hour and/or UTC time, and refresh rates down to the nanosecond. It has evolved quite nicely.

Whether or not you prefer a text-based lifestyle and whether or not your computer can handle the burden of a fully graphical desktop environment, you really owe it to yourself to at least try tty-clock once. My apologies for omitting it for so, so long. 😳

fluxcapacitor: Now you have time for everything

I have a program here that I don’t quite know how to explain, even though it’s fairly obvious that it’s working. The aptly named fluxcapacitor allows programs to run without timing constraints … which is how I would explain it.

Maybe this will help. I’ll borrow from the home page example, because it makes the most sense to me:

kmandla@6m47421: ~/downloads/fluxcapacitor$ time sleep 12

real	0m12.003s
user	0m0.000s
sys	0m0.000s

That much is obvious. But then there’s this:

kmandla@6m47421: ~/downloads/fluxcapacitor$ time ./fluxcapacitor -- sleep 12

real	0m0.018s
user	0m0.007s
sys	0m0.003s

Quite obviously, what we have here is a way to negate time. Well, this changes everything. Download files in fractions of seconds. Compile software in minutes instead of days. Turn your 486 into an i7. Search for aliens. Fold proteins. Cure cancer and the common cold. Achieve world peace. We certainly have time for it now. 😀

Well, maybe not. 🙄 I can see where fluxcapacitor would be helpful in some situations, like troubleshooting software that imposed delays on you, or maybe some network testing problems.

But to be honest, I think most of my personal applications wouldn’t be too far improved by fluxcapacitor. I’ve read the author’s examples and I think they make sense, I just can’t think of anything I do on a day-to-day basis that would benefit from it. :\

I shall keep fluxcapacitor in the back of my mind, and save it for emergencies. Like when I am late to work in the mornings. 😉

wtime: The laconic task tracker

Another console timekeeper for the W section: wtime. And this one is particularly closemouthed.

2014-06-30-6m47421-wtime

wtime has about six possible options: Start, stop, target a particular task (otherwise it uses “default”), show how many seconds have elapsed since the start, and sum the time spent on the task between a start and finish date.

Aside from that, wtime has very little to say for itself.

Now I know, that as a resourceful and enterprising young Linux devotee, you see a lot more potential in wtime than just something that spits out seconds since a start marker.

And I know you’ve already come up with a solution for translating wtime’s rather clunky output to a clean hours-minutes-seconds display.

No? You haven’t? You mean you want to see my suggestion? Okay, here’s one I’m borrowing, with a tiny adjustment, from Jaidu Saikia.

kmandla@6m47421: ~/downloads/wtime$ echo - | awk -v "S=$(./wtime -c)" '{printf "%d:%d:%d",S/(60*60),S%(60*60)/60,S%60}'
0:10:11

awk to the rescue, it seems. 😉

If you hadn’t gleaned the info from the screenshot or the help pages, you can manage more than one task at a time. It does require you to prefix every command with the -t flag though, otherwise you’ll fall back to “default.” I see how and why this happens, but I’m sure there are better ways to handle it.

wtime is not in Arch/AUR or Debian. It’s a free-roaming program!

wtime doesn’t talk much, it’s a little cumbersome for multiple tasks and the output it gives is somewhat rudimentary. I don’t deny it works, but it has that exceptionally sparse feel, like a homework project or a tiny tool just for the author’s purposes.

With a little creativity you can get it going in a usable state, but with so many other options for time trackers and work logs, I have a feeling wtime will be quickly eclipsed. :\

worklog: Work on, work done, work sum, work today

Time-tracking software again, and this time it’s one that has been around for a while.

2014-06-29-6m47421-worklog

My first run-in with worklog was about four years ago, and it seems quite different now. Could it be that the project has changed hands, or the name has been juggled between authors?

I don’t know. I should mention though, that the web site I linked to four years ago has gone dead. Nothing to be read into that; it happens sometimes.

But worklog looks a bit different too. The screenshot I snapped way back then doesn’t look much like what I have on my screen now. I should mention that some of the options listed in the help pages trigger python errors.

Usually I would blame that on differences between python versions (those always seem to crop up among unmaintained software, whenever python gets a dot-bump) but this time it only makes me suspicious. (The python errors cropped up at work on --all for me, which I took to mean there would be some sort of interactive mode. That might be where that other screenshot came from. I honestly don’t remember. 😦 )

worklog abbreviates itself to just work when installed, and it’s a simple matter of triggering a timer with work on Project to start, and work done when you’re … done. 🙄

Aside from that, you can ask for a breakdown of the work you’ve done today with work today and get a total sum of time spent with … you guessed it: work sum. There are a few other options for switching projects and editing descriptions, but if you can handle those four, you’ll do fine with worklog.

worklog is a decent choice if your time-tracking needs are simple, and neither timebook, timetrap nor punch is of interest. And if none of these is worthy of your attention, then may I suggest … ?

time, time and times: Too much time on my hands

One of my earliest mistakes at the console was thinking the time command was going to serve me the current time. Of course, what I got was

kmandla@jk7h5f1: ~$ time

real	0m0.000s
user	0m0.000s
sys	0m0.000s

What a newb. What a gulla-bull. What an im-bess-ill.

What I didn’t know then, and what you probably already know now, is that time isn’t a redirect toward the current time — that’s date.

time is more of a timer, and actually is one of those things I use quite often. Probably because there are quite a few time-consuming tools that don’t, for whatever reason, offer some sort of summary at their conclusion. 👿

time sudo dd if=/dev/zero of=/dev/sda

is one. I’m sure you can think of one or two more. 😉

For what it’s worth, there’s a small discrepancy between GNU time, which could be in your system at /usr/bin/time, and the bash function named time. Their output is obviously different but functionally similar; one or the other is undoubtedly available to you.

And as a final note, you might have times in your system, which monitors the user and system times that have accumulated for the shell and every child process since its start. times supposedly reports everything in clock ticks and probably isn’t useful, except for extreme cases.

kmandla@jk7h5f1: ~$ times
0m0.010s 0m0.003s
0m0.037s 0m0.007s

I can’t think of a time when I ever used times, although there were many times when I used time. 🙄 You knew you weren’t getting out of here without a few puns. … 😉

timebook and timetrap: Tracking your every effort

When I say this post is a two-fer, I really mean it. I haven’t seen two programs as similar as timebook and timetrap since cplay and mcplay.

And in this case, they’re similar for the same reason: One is a rewrite of the other, in a different language. So I’ll show you timebook, which is arguably the original python time tracker, and you can imagine timetrap, changing the parts that set it apart for being written in ruby.

I am only half kidding there. Both applications install as t, and both enlist much the same commands, but just looking at their respective source packages reveals that timetrap has seen some recent attention, while timebook appears to have … well, let’s say “stalled.”

Both programs let you track your work efforts or study periods with quick jabs at the keyboard. For example …

2014-05-27-jk7h5f1-timebook

As you can see, just t in project is enough to get the timer started, and t out punches you out. Which is an odd choice of words, considering we already looked at punch, a few months ago.

timebook has around eight or 10 possible controls, and timetrap adds a little more flair here and there, with things like natural language input and custom output formats. Neither one will take you long to adopt, and you have the added bonus of knowing that your projects are tracked down to the second.

I grazed these two applications a few years ago, but didn’t give a whole lot of attention to either. I probably should apologize for that, but aside from morbid curiosity, I really don’t have a whole lot of use for project tracking.

That always may change in the future, so should it ever befall me to work for a shrewish boss or charge clients on a down-to-the-second basis, I’ll at least know I have two options for timers. 😉