Replies: 4 comments 10 replies
-
I think that it would be reasonable to put this function out of CAML_INTERNALS (so we commit to support it), and even possibly expose it as |
Beta Was this translation helpful? Give feedback.
-
I wonder if we could store somewhere the timestamp at the beginning of the program and then subtract whenever we ask for a timestamp. Would that end up being costly, or neglectible compared to the other stuff going on in runtime events? I would bet "neglectible" but I don't know. |
Beta Was this translation helpful? Give feedback.
-
Re-reading all that a few weeks later, I'd hate to see it just fall by the wayside. I think a minimal solution would be a good start. The actual only thing we'd need for that, I think, is just Mtime can still be useful to get the clock frequency, provide a nice API for spans, an I'm not sure whether adding this to |
Beta Was this translation helpful? Give feedback.
-
I'm mostly fine with your idea but I'm not going to provide the clock period lookup in |
Beta Was this translation helpful? Give feedback.
-
Currently, runtime events are annotated with a timestamp (internally, a
int64
that seems to correspond to nanoseconds). I have two issues with it curently:int64
. It seems to be nanoseconds but I think this should be clearly documented so it can be relied on.caml_time_counter
from user code. This means that these timestamps have no meaning that can be related to, say, timestamps frommtime
, or values of rdtsc (even though they might come from the same source). For tracing purposes, I personally would need to be able to correlate theMtime.Span.t
timestamps that I use for most spans (elapsed since beginning of program) with the ones that come from runtime events, in order to combine the two data sources into a coherent whole that can be visualized.so really I think there needs to be more features around timestamps: either expose
caml_time_counter
(as a monotonic clock with a well defined unit of measure; and thenmtime
could provide a compatibility layer with it); or at least provide information about the starting point of the program.Beta Was this translation helpful? Give feedback.
All reactions