mirror of
https://github.com/wassname/keras-js.git
synced 2026-09-23 13:20:45 +08:00
28 lines
712 B
JavaScript
28 lines
712 B
JavaScript
(function () {
|
|
'use strict'
|
|
|
|
var styles = {
|
|
h1: 'color:#001f3f;font-weight:bold;font-size:160%;',
|
|
h2: 'color:#0074D9;font-weight:bold;font-size:130%;',
|
|
h3: 'color:#FF4136;font-weight:bold;font-size:110%;',
|
|
h4: 'color:#AAAAAA;font-size:100%;',
|
|
time: 'color:#2ECC40;font-weight:bold;font-size:100%;'
|
|
}
|
|
|
|
function logTime (startTime, endTime) {
|
|
console.log(`%c>>>> exec: ${Math.round(100 * (endTime - startTime)) / 100} ms`, styles.time)
|
|
}
|
|
|
|
function stringifyCondensed (obj) {
|
|
return JSON.stringify(obj, function (key, val) {
|
|
return val.toFixed ? Number(val.toFixed(3)) : val
|
|
})
|
|
}
|
|
|
|
window.testGlobals = {
|
|
styles,
|
|
logTime,
|
|
stringifyCondensed
|
|
}
|
|
})()
|