// Copyright 2018 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.constKB=1024;constMB=KB*KB;constGB=MB*KB;constkMillis2Seconds=1/1000;functionformatBytes(bytes){constunits=['B','KiB','MiB','GiB'];constdivisor=1024;letindex=0;while(index<units.length&&bytes>=divisor){index++;bytes/=divisor;}returnbytes.toFixed(2)+units[index];}functionformatSeconds(millis){return(millis*kMillis2Seconds).toFixed(2)+'s';}