File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,14 @@ const t = initTRPC.context<Context>().create({
4545// Setting outer context with tRPC will not get us correct path during request batching,
4646// only by setting logger context in the middleware do we get the exact path to log
4747const loggerMiddleware = t . middleware ( async ( { path, next, ctx, type } ) => {
48- const start = Date . now ( )
48+ const start = performance . now ( )
4949 const logger = createBaseLogger ( { path, clientIp : getIP ( ctx . req ) } )
5050
5151 const result = await next ( {
5252 ctx : { logger } ,
5353 } )
5454
55- const durationInMs = Date . now ( ) - start
55+ const durationInMs = Math . round ( performance . now ( ) - start )
5656
5757 if ( result . ok ) {
5858 logger . info ( { durationInMs } , `[${ type } ]: ${ path } - ${ durationInMs } ms - OK` )
You can’t perform that action at this time.
0 commit comments