2017-05-25 05:09:55 -07:00
|
|
|
//
|
|
|
|
|
// Tools for performance debugging, only enabled in development mode.
|
|
|
|
|
// Open up Chrome Dev Tools, then Timeline, then User Timing to see output.
|
|
|
|
|
|
2023-05-09 03:08:47 +02:00
|
|
|
import * as marky from 'marky';
|
2017-05-25 05:09:55 -07:00
|
|
|
|
2023-10-31 17:05:44 +01:00
|
|
|
import { isDevelopment } from './utils/environment';
|
|
|
|
|
|
2017-05-25 05:09:55 -07:00
|
|
|
export function start(name) {
|
2023-10-31 17:05:44 +01:00
|
|
|
if (isDevelopment()) {
|
2017-05-25 05:09:55 -07:00
|
|
|
marky.mark(name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function stop(name) {
|
2023-10-31 17:05:44 +01:00
|
|
|
if (isDevelopment()) {
|
2017-05-25 05:09:55 -07:00
|
|
|
marky.stop(name);
|
|
|
|
|
}
|
|
|
|
|
}
|