xsharp.eu • Seconds() in Core rounding to Centisecond, not Millisecond ? Why round at all ?
Page 1 of 1

Seconds() in Core rounding to Centisecond, not Millisecond ? Why round at all ?

Posted: Tue Feb 25, 2020 9:35 pm
by mainhatten
nor really breaking anything, but at least vfp is documented to count milliseconds since midnight and does that on Win7/64 - older 32 were not that granular, there I would not have realized it.

I see no real(8) reason to round to 2 or 3 decimal places - if there is a problem in VN or VO, such rounding should happen there, but overwriting seconds() just for vfp runtime to get higher accuracy for simple measurements would not be a problem - it just feels "misplaced". Or have I misread something ?

And yes, for really working on timing issues Dotnet offers not only TickCount, but seems to have wrapped QueryPerf-Api already in Stopwatch (perhaps too much - saving and manipulating 8Byte counters and then converting feels better.

regards
thomas

Seconds() in Core rounding to Centisecond, not Millisecond ? Why round at all ?

Posted: Wed Feb 26, 2020 8:13 am
by Chris
Hi Thomas,

Yes, indeed, VO uses 2 decimal places for this function, for this reason it is implemented like that in X# as well. I think it will be no issue making it return 3 decimals for the VFP dialect, will log this. The VFP version does always show 3 decimals, is that right?

Seconds() in Core rounding to Centisecond, not Millisecond ? Why round at all ?

Posted: Wed Feb 26, 2020 11:55 am
by mainhatten
Chris wrote:Yes, indeed, VO uses 2 decimal places for this function, for this reason it is implemented like that in X# as well. I think it will be no issue making it return 3 decimals for the VFP dialect, will log this. The VFP version does always show 3 decimals, is that right?
Hi Chris,
quick test on Win7/64 and XP/32 both show 3 decimal places, multiplying with 10000 always leaves 0 as last char: so vfp rounds to 3 digits at least on those OS.

regards
thomas

Seconds() in Core rounding to Centisecond, not Millisecond ? Why round at all ?

Posted: Wed Feb 26, 2020 12:33 pm
by mainhatten
Chris wrote: I think it will be no issue making it return 3 decimals for the VFP dialect, will log this.
rethinking I still believe "more capable" milliseconds version should be in Core, Centiseconds in VN/VO assemblies.
Benefits: usual behaviour in VO/VN as before, but those wishing for higher accuracy while coding in VO/VN can call Core.seconds without delivering more assemblies. Those programming by intent to core, as Wolfgang demonstrates, get better seconds() result, as they also want to be unencumbered by VN/VO Usuals and stuff.

More text than this measly function warrants ;-))

regards
thomas

Seconds() in Core rounding to Centisecond, not Millisecond ? Why round at all ?

Posted: Wed Feb 26, 2020 7:01 pm
by Chris
Hi Thomas,

I personally think there's no point making things so complicated. For core, IMO the best option is to just use the .Net classes directly, each user handling them the way that's best suited to them. With DateTime.Now you can get the current date and time and manipulate it in any way that suits!