Return back to the blog

Time inside a Time Travelling Debugger

Posted by Prashant Deva on May 27, 2011

When we were developing Chronon and started using it ourselves, we realized something very intriguing. You see, the various views of Chronon allow you to step not only forward and backward but to any random point in time. For example, using the Variable History view, you can instantly jump to when a variable became ‘null’ or use one of the powerful filters in method history view to jump directly to a particular call of a method.

The problem

Since you are not just stepping forward, it is easy to get lost in time.

For example:

  1. How does one event relate to the other, did it happen before or after the other?
  2. Did I just jump forward or backward when I clicked in the variable history view?
  3. If I did jump backward/forward, by how much did I jump?
  4. Where am I in the execution of my program? Am I near the end of my program/ middle or end?

The Solution

Imagine you are a real world time traveler. What is the most important tool in your arsenal?

A clock.

We needed some sort of a clock inside Chronon to solve all the above issues.
Thus we invented the concept of ‘time’.

Time inside Chronon
‘Time’ inside Chronon does not stand for real-world clock time. After all how precisely can you really measure the time interval between say 2 variable assignments, and even if you could looking at the system clock each time your program executed an instruction, would result in a huge performance drain.


Thus ‘time’ in Chronon is merely an application wide counter. It has no relation to clock time. Its sole purpose is to give an ordering to events recorded in a program.
The only thing you know when you look at a time value is:
An event at say time 5 occurred after any event at time < 5, ie 4,3,… and before any event > 5, ie 6,7…


It is not guaranteed that the next time value after 5 would be 6 (though it is in 99% of cases), it could be 7,8 or any time > 5.
All you know about time values is that they are ascending in order, thus putting an ordering on events in your application.


Thus all the views in Chronon, like the Variable History, Method History, Thrown Exceptions, etc have a time value so you can see how the events in each relate to the other.


Timeline View
The ‘Timeline View’ was added to quite literally serve the role of a clock inside Chronon.
  • It literally shows the current time value.
  • The progress bar gives you an idea of how far down the execution of the program you are.
    See the bar completely fill up, well you are near the end, if its almost empty, you are near the beginning.
  • We also added ‘time bookmarks’ in this view which act as a checkpoint mechanism for anything interesting you might want to return to in the future.