Calculate duration for the last entry
Calculate duration for the last entry

Since there's no entry following the last entry, calculate the duration
as though an entry happened at the current time.  This code is pretty
ugly and ought to be refactored.

mndrix/clk