| 38 | } |
| 39 | |
| 40 | function dumpProfile(profile) { |
| 41 | let array = []; |
| 42 | for (let key in profile) { |
| 43 | if (key == "instanceNum") continue; |
| 44 | let data = profile[key]; |
| 45 | if (data.count == 0) continue; |
| 46 | array.push(data); |
| 47 | } |
| 48 | print(`--- Import profile for instance ${profile.instanceNum} ---`); |
| 49 | if (array.length == 0) return; |
| 50 | array.sort((a, b) => b.total - a.total); |
| 51 | for (let data of array) { |
| 52 | print(`${padl(data.name, 30)}: ${padr(data.count, 10)} ${padp(data.total, 10)}ms`); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | function padl(s, len) { |
| 57 | s = s.toString(); |