I believe that simply rounding off the value is not the solution here. Compiling a model should take a certain non-zero number of milliseconds, I would have expected. I suspect that the wrong time-elapsed functions are being used here.

I tested the unmodified code for many models. It actually works fine for large models that take more than a few Milli Seconds to solve. For eg : ascend/models/johnpye/absorber.a4c or other more complex models. Garbage values are printed only for very simple models. I have uploaded the patch file that takes care of complex as well as very simple models whose solving time is less than the precision limit of the time functions being used.