@@ -143,7 +143,7 @@ <h1><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAABgCAYAAACUosWz
143143 < table >
144144 < thead > < tr >
145145 < th > Time</ th > < th > Status</ th > < th > Model</ th > < th > Stream</ th >
146- < th class ="num "> In</ th > < th class ="num "> Out</ th > < th class ="num "> ms </ th > < th > Last user message</ th >
146+ < th class ="num "> In</ th > < th class ="num "> Out</ th > < th class ="num "> took </ th > < th > Last user message</ th >
147147 </ tr > </ thead >
148148 < tbody id ="rows "> < tr > < td colspan ="8 " class ="empty "> Waiting for requests… point a client at this
149149 server with < code > ANTHROPIC_BASE_URL</ code > .</ td > </ tr > </ tbody >
@@ -175,6 +175,18 @@ <h3>Response <button class="copy" data-copy="d-resp">copy</button></h3>
175175
176176const $ = ( id ) => document . getElementById ( id ) ;
177177const fmt = ( n ) => ( n >= 10000 ? ( n / 1000 ) . toFixed ( 1 ) + "k" : String ( n ?? 0 ) ) ;
178+ // Duration as minutes / seconds / milliseconds, dropping leading zero units.
179+ // 78342 -> "1m 18s 342ms", 9042 -> "9s 42ms", 234 -> "234ms".
180+ const fmtDuration = ( ms ) => {
181+ if ( ms == null ) return "…" ;
182+ ms = Math . round ( ms ) ;
183+ const m = Math . floor ( ms / 60000 ) , s = Math . floor ( ( ms % 60000 ) / 1000 ) , r = ms % 1000 ;
184+ const parts = [ ] ;
185+ if ( m ) parts . push ( m + "m" ) ;
186+ if ( m || s ) parts . push ( s + "s" ) ;
187+ parts . push ( r + "ms" ) ;
188+ return parts . join ( " " ) ;
189+ } ;
178190const fmtMoney = ( usd ) => usd >= 1000 ? "$" + ( usd / 1000 ) . toFixed ( 2 ) + "k"
179191 : usd >= 100 ? "$" + usd . toFixed ( 0 )
180192 : usd >= 0.01 || usd === 0 ? "$" + usd . toFixed ( 2 )
@@ -228,7 +240,7 @@ <h3>Response <button class="copy" data-copy="d-resp">copy</button></h3>
228240 <td>${ r . stream ? "yes" : "no" } </td>
229241 <td class="num">${ fmt ( r . inputTokens ) } </td>
230242 <td class="num">${ fmt ( r . outputTokens ) } </td>
231- <td class="num">${ r . durationMs != null ? fmt ( r . durationMs ) : "…" } </td>
243+ <td class="num">${ fmtDuration ( r . durationMs ) } </td>
232244 <td class="preview" title="${ esc ( r . error || r . preview ) } ">${ esc ( r . error || r . preview ) } </td>
233245 </tr>` ) ;
234246 }
@@ -269,7 +281,7 @@ <h3>Response <button class="copy" data-copy="d-resp">copy</button></h3>
269281 `${ new Date ( full . ts ) . toLocaleTimeString ( ) } · ${ full . status } ` +
270282 `${ full . stopReason ? " (" + full . stopReason + ")" : "" } ` +
271283 ` · in ${ full . inputTokens ?? 0 } / out ${ full . outputTokens ?? 0 } ` +
272- `${ full . durationMs != null ? " · " + full . durationMs + "ms" : "" } ` +
284+ `${ full . durationMs != null ? " · " + fmtDuration ( full . durationMs ) : "" } ` +
273285 `${ full . stream ? " · streamed" : "" } ` ;
274286 const hasErr = ! ! full . error ;
275287 $ ( "d-err-h" ) . style . display = hasErr ? "" : "none" ;
0 commit comments