MCPcopy Create free account
hub / github.com/vercel/examples / withTimer

Function withTimer

edge-middleware/clerk-authentication/utils/timer.js:2–7  ·  view source on GitHub ↗
(next)

Source from the content-addressed store, hash-verified

1// Utilities to measure the authentication strategies
2export const withTimer = (next) => {
3 return (req) => {
4 req.startTime = new Date().getTime()
5 return next(req)
6 }
7}
8
9export const endTimer = (req) => {
10 req.endTime = new Date().getTime()

Callers 2

_middleware.jsFile · 0.90
_middleware.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected