Page 1 of 1

GetTime() to be able to print milliseconds with 2nd param

Posted: Sat Aug 28, 2021 8:00 pm
by mrupp
Hi there

I would like to request a 2nd parameter to be added to the GetTime() function so it would print milliseconds in addition to the seconds (1st parameter).
I'm currently using GetTime() to evaluate the performance of my internal functions and on faster processors (well, faster than 68k at least ;) ) it would be interesting to be able to have more precision.

Hopefully that's an easy one, right?

Cheers, Michael

Re: GetTime() to be able to print milliseconds with 2nd param

Posted: Sat Aug 28, 2021 11:14 pm
by lazi
Hello Michael!

Maybe you are already familiar with GetTimer(), but I would like to mention that I am using always that function for measuring code timing.
You can use StartTimer() anywhere and get milliseconds with GetTimer(). It is a very convinient way of doing precise time measurements.

Re: GetTime() to be able to print milliseconds with 2nd param

Posted: Sun Aug 29, 2021 12:42 am
by mrupp
lazi wrote: Sat Aug 28, 2021 11:14 pm Hello Michael!

Maybe you are already familiar with GetTimer(), but I would like to mention that I am using always that function for measuring code timing.
You can use StartTimer() anywhere and get milliseconds with GetTimer(). It is a very convinient way of doing precise time measurements.
Thanks, by now I figured that GetTimestamp() is also quite handy for measuring, but I'm sure going to give GetTimer() a try, too.

The expansion of GetTime() might still be a good idea for other uses, though.

Re: GetTime() to be able to print milliseconds with 2nd param

Posted: Thu Sep 02, 2021 8:47 pm
by airsoftsoftwair
mrupp wrote: Sun Aug 29, 2021 12:42 am The expansion of GetTime() might still be a good idea for other uses, though.
Not very likely to come because that is designed to return a canonical time string which rarely has millisecond precision...