MaxClock inside JAVA vs [metro]

Julien Bayle's icon

What would be the benefits to use MaxClock instead of a [metro] object firing bang to .. the JAVA itself?

Julien Bayle's icon

maybe it is a philosophical question ?!
:D

Emmanuel Jourdan's icon

There shouldn't be much difference, it's just it makes your object self contained.

Julien Bayle's icon

ok emmanuel.
it was maybe a bit philosophical, showing my lack of knowledge.. but very good to know.

Roth's icon

One thing to watch out for using MaxClock: I remember last summer using MaxClock in a project and sometimes when the class I was writing would throw a RuntimeException this would break MaxClock until the object was reinstantiated. I never got to the bottom of this at the time and just switched to using a metro to drive the process.

I'm not saying to stay away from MaxClock as personally I think it makes the code nicer, but just keep this in mind if you see any strange behavior after throwing an exception.