export function setTotalTime ( totalTime ) { updateInfoText ( '[data-total-time]' , `${ Math . trunc ( totalTime * 1000 ) }ms` ) ; } export function setRenderingBackend ( backend ) { updateInfoText ( '[data-rendering-backend]' , backend ) ; } export function formatNodeTime ( nodeTime ) { const nodeTimeMs = Math . trunc ( nodeTime * 1000 ) ; if ( nodeTimeMs > 0 ) { return nodeTimeMs ; } else { return '< 1' ; } } export function emptyHTMLNode ( node ) { if ( ! node ) return ; while ( node . firstChild ) { node . removeChild ( node . firstChild ) ; } } export function updateInfoText ( selector , updateText ) { document . querySelector ( `${ selector } b` ) ! . textContent = updateText ; }