You're right, InuoeK, it's not accurate in seconds, but it's probably the best way to do it.
Using a counter for timing, as you did (as opposed to working with real time), is much simpler, and almost always what you want. This way, you are measuring "game time" rather than real time, and that often makes more sense.
@milanapa, it would make sense to put the code in the class that creates the object that you are timing (if you are timing how long a world is active, put it in the class of that world; if you are timing how long an actor is 'alive', put it in the class of that actor). That way, as you add additional code, there will be less chance of having to modify this part.