I see that you're on Windows. The clock granularity on Windows is really 
coarse (15 ms) because AFAIK there are no fast fine-grained OS-level clocks 
available.

There are fine-grained clocks, but they're heavyweight. They're too 
heavyweight for many situations in the runtime, but honestly, they're 
probably not too heavyweight in this particular scenario. Alas, the runtime 
tends to just use the default OS clock it picks (the nanotime function) 
everywhere, since the granularity is very fine on most other popular 
platforms.

I suspect that is the cause of all the zeroes. More specifically, the 
measurement happens entirely within a 15 ms epoch. For this particular 
measurement, the runtime just uses that coarse OS clock. As an easier 
workaround, we could probably estimate durations like this from RDTSC 
<https://cs.opensource.google/go/go/+/master:src/runtime/runtime.go;l=76;bpv=1;bpt=1?q=ticksPerS&ss=go%2Fgo>
 
like we do for other things, like some profiles on Windows. This is not 
great for actually measuring timestamps, but it's probably OK (though far 
from perfect) for durations.

Do you mind filing an issue at https://github.com/golang/go/issues? Thanks.

On Tuesday, January 30, 2024 at 5:24:41 PM UTC-5 Leah Stapleton wrote:

> Is it possible that some PauseNs numbers are so small that they're rounded 
> down to 0?
>
> On Monday, January 29, 2024 at 9:45:32 AM UTC-5 Leah Stapleton wrote:
>
>> go version go1.21.5 windows/amd64
>>
>> There have been 9 garbage collections according to NumGC and also the 
>> PauseEnd array; However, the PauseNs array only shows two pause times, and 
>> they are incorrectly positioned in the array (the first time is logged at 
>> PauseNs[4] rather than PauseNs[0])
>>
>> Can anyone provide some information about this. 
>>
>> Leah
>>
>>
>>
>> ,"PauseTotalNs":1999400,"PauseNs":[0,0,0,0,1000100,999300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"PauseEnd":[1706534601618276400,1706534601625558600,1706534601643261400,1706534601677238900,1706534601781174700,1706534602022683900,1706534602465533900,1706534603516006900,1706534604837389800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"NumGC":9,
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/617f8e6b-5bd4-4925-b34e-1413ccfc7ef8n%40googlegroups.com.

Reply via email to