Probe API
probe.gl exports a singleton probe object
The Probe can be accessed through
- The singleton
probeinstance which is exported from@probe.gl/log. - The singleton
probeinstance is also available onglobalThis.probe - A
Probeclass export.
Usage
import {probe} from '@probe.gl/log';
const now = probe.getHighResolutionTimer();
Get Heap memory
import {probe} from '@probe.gl/log';
const heapMB = probe.getMemoryUsageMB();
if (heapMB !== null) {
console.log(`heap: ${heapMB}MB`);
}
Methods
getHighResolutionTimer
probe.getHighResolutionTimer()
Returns a high-resolution timer value in milliseconds.
getMemoryUsageMB
probe.getMemoryUsageMB()
Returns the current JS heap usage in integer megabytes, or null when not available.