feat: show response generation time on assistant messages
Track how long each assistant response took to generate and display it subtly next to the timestamp (e.g. '· 12.3s'). The timing is measured from the first streaming delta to the final state, and preserved across the history reload that follows stream completion. Only visible for messages generated during the current session.
This commit is contained in:
@@ -539,6 +539,13 @@ export const ChatMessageComponent = memo(function ChatMessageComponent({ message
|
||||
</span>
|
||||
)}
|
||||
{message.timestamp && <Timestamp ts={message.timestamp} />}
|
||||
{!isUser && message.generationTimeMs != null && (
|
||||
<span className="text-[10px] text-pc-text-faint" title="Generation time">
|
||||
· {message.generationTimeMs < 1000
|
||||
? `${message.generationTimeMs}ms`
|
||||
: `${(message.generationTimeMs / 1000).toFixed(1)}s`}
|
||||
</span>
|
||||
)}
|
||||
{isUser && message.sendStatus === 'sending' && (
|
||||
<span title="Sending..."><Clock size={10} className="animate-pulse text-pc-text-faint" /></span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user