export namespace Diagnose { let data = new Map ( ) ; export function init ( ) { data . clear ( ) ; } export function count ( tag ) { data . set ( tag , ( data . get ( tag ) ?? 0 ) + 1 ) ; } export function max ( tag , value ) { let old = data . get ( tag ) ?? Number . NEGATIVE_INFINITY ; if ( old < value ) data . set ( tag , value ) ; } export function flush ( ) { if ( data . size === 0 ) return ; for ( let [ tag , value ] of data . entries ( ) ) console . log ( tag , value ) ; console . log ( "=================" ) ; } }