1010import * as React from 'react' ;
1111import { Fragment , useContext } from 'react' ;
1212import { ProfilerContext } from './ProfilerContext' ;
13- import { formatDuration , formatTime } from './utils' ;
13+ import { formatDuration } from './utils' ;
1414import WhatChanged from './WhatChanged' ;
1515import { StoreContext } from '../context' ;
1616
@@ -44,18 +44,17 @@ export default function HoveredFiberInfo({fiberData}: Props) {
4444 for ( i = 0 ; i < commitIndices . length ; i ++ ) {
4545 const commitIndex = commitIndices [ i ] ;
4646 if ( selectedCommitIndex === commitIndex ) {
47- const { duration, timestamp} = profilerStore . getCommitData (
48- ( ( rootID : any ) : number ) ,
49- commitIndex ,
50- ) ;
47+ const {
48+ fiberActualDurations,
49+ fiberSelfDurations,
50+ } = profilerStore . getCommitData ( ( ( rootID : any ) : number ) , commitIndex ) ;
51+ const actualDuration = fiberActualDurations . get ( id ) || 0 ;
52+ const selfDuration = fiberSelfDurations . get ( id ) || 0 ;
5153
5254 renderDurationInfo = (
53- < Fragment >
54- < label className = { styles . Label } > Rendered at:</ label >
55- < div key = { commitIndex } className = { styles . CurrentCommit } >
56- { formatTime ( timestamp ) } s for { formatDuration ( duration ) } ms
57- </ div >
58- </ Fragment >
55+ < div key = { commitIndex } className = { styles . CurrentCommit } >
56+ { formatDuration ( selfDuration ) } ms of { formatDuration ( actualDuration ) } ms
57+ </ div >
5958 ) ;
6059
6160 break ;
@@ -68,10 +67,10 @@ export default function HoveredFiberInfo({fiberData}: Props) {
6867 < div className = { styles . Component } > { name } </ div >
6968 </ div >
7069 < div className = { styles . Content } >
71- < WhatChanged fiberID = { ( ( id : any ) : number ) } />
7270 { renderDurationInfo || (
7371 < div > Did not render during this profiling session.</ div >
7472 ) }
73+ < WhatChanged fiberID = { ( ( id : any ) : number ) } />
7574 </ div >
7675 </ Fragment >
7776 ) ;
0 commit comments