mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
13 lines
318 B
JavaScript
13 lines
318 B
JavaScript
function trace(text) {
|
|
// This function is used for logging.
|
|
if (text[text.length - 1] === '\n') {
|
|
text = text.substring(0, text.length - 1);
|
|
}
|
|
if (window.performance) {
|
|
var now = (window.performance.now() / 1000).toFixed(3);
|
|
console.log(now + ': ' + text);
|
|
} else {
|
|
console.log(text);
|
|
}
|
|
}
|