Change Date.now() to performance.now() (#1551)

* Change Date.now() to performance.now()

* Adjust
This commit is contained in:
Jaco
2022-06-20 11:29:59 +03:00
committed by GitHub
parent 4b7cda243b
commit 3db2990ce7
26 changed files with 76 additions and 76 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { performance } from '../test/performance';
import { perf } from '../test/performance';
import { arrayChunk, arrayRange } from '.';
describe('arrayChunk', (): void => {
@@ -11,5 +11,5 @@ describe('arrayChunk', (): void => {
).toEqual([[1, 2, 3], [4, 5, 6], [7]]);
});
performance('arrayChunk', 200_000, [[arrayRange(500), 50]], arrayChunk);
perf('arrayChunk', 200_000, [[arrayRange(500), 50]], arrayChunk);
});
+2 -2
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2022 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { performance } from '../test/performance';
import { perf } from '../test/performance';
import { arrayRange, arrayShuffle } from '.';
const ptest = arrayRange(16284);
@@ -32,5 +32,5 @@ describe('arrayShuffle', (): void => {
).not.toEqual(JSON.stringify(out));
});
performance('arrayShuffle', 1000, [[ptest]], arrayShuffle);
perf('arrayShuffle', 1000, [[ptest]], arrayShuffle);
});