I’d also mention that if someone want just to writeln elapsed time (TTimeSpan) he/she don’t even need to bother with milliseconds stuff. The easy way is explicit conversion to string, just
var
w: TStopWatch;
…
writeln(‘Elapsed: ‘, string(w.Elapsed));
That’s it. w.Elapsed will call Value.ToString and you get text.
I’d also mention that if someone want just to writeln elapsed time (TTimeSpan) he/she don’t even need to bother with milliseconds stuff. The easy way is explicit conversion to string, just
var
w: TStopWatch;
…
writeln(‘Elapsed: ‘, string(w.Elapsed));
That’s it. w.Elapsed will call Value.ToString and you get text.
Thanks DDev for this tip