Function
time
(message: string, extra?: Record<string, any>)
Source from the content-addressed store, hash-verified
| 153 | return Log.create({ ...tags }) |
| 154 | }, |
| 155 | time(message: string, extra?: Record<string, any>) { |
| 156 | const now = Date.now() |
| 157 | result.info(message, { status: "started", ...extra }) |
| 158 | function stop() { |
| 159 | result.info(message, { |
| 160 | status: "completed", |
| 161 | duration: Date.now() - now, |
| 162 | ...extra, |
| 163 | }) |
| 164 | } |
| 165 | return { |
| 166 | stop, |
| 167 | [Symbol.dispose]() { |
| 168 | stop() |
| 169 | }, |
| 170 | } |
| 171 | }, |
| 172 | } |
| 173 | |
| 174 | if (service && typeof service === "string") { |
Tested by
no test coverage detected