summaryrefslogtreecommitdiff
path: root/test/parallel/test-performance-global.js
blob: 416d017117e9f05d0ff7fc27b72f8a5c625fa5cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
/* eslint-disable no-global-assign */

require('../common');

const perf_hooks = require('perf_hooks');
const {
  strictEqual
} = require('assert');

const perf = performance;
strictEqual(globalThis.performance, perf_hooks.performance);
performance = undefined;
strictEqual(globalThis.performance, undefined);
strictEqual(typeof perf_hooks.performance.now, 'function');

// Restore the value of performance for the known globals check
performance = perf;