From d5d01249915ebf69e19d9357b90263dbcdf23666 Mon Sep 17 00:00:00 2001 From: Matthew Walsh Date: Thu, 7 Nov 2024 20:39:40 +0000 Subject: [PATCH] Add manual timestamp example --- docs/performance-tracing.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/performance-tracing.md b/docs/performance-tracing.md index 1a67c38..01b61ee 100644 --- a/docs/performance-tracing.md +++ b/docs/performance-tracing.md @@ -204,3 +204,25 @@ function someOtherFunction() { ... } ``` + +#### Use manual timestamps in a trace. + +```ts +import { trace, endTrace, TraceName } from '...'; + +... + +trace({ + name: TraceName.SomeTrace, + startTime: Date.now() - 123 +}); + +... + +endTrace({ + name: TraceName.SomeTrace, + timestamp: Date.now() + 456 +}); + +... +```