ElapsedTime gives you fractions of a second, but only updates from one frame to the next, so put the million loop in the draw function (with a flag so that it only fires once).
Yeah, os.time would work just in setup, though it’s whole seconds only. I guess it depends how accurate you need to be/ how much time you mind waiting. What I find interesting, is that often the values you get vary quite a lot, even though the exact same set of instructions are being run.