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
+3 -3
View File
@@ -4,7 +4,7 @@
import { getRandomValues } from '@polkadot/x-randomvalues';
import { arrayRange } from '../array';
import { performance } from '../test/performance';
import { perf } from '../test/performance';
import { stringCamelCase, stringUpperFirst } from '.';
const SEPS = [' ', '_', '-', '.', ','];
@@ -112,6 +112,6 @@ describe('stringCamelCase', (): void => {
).toEqual('aBCDef');
});
performance('stringCamelCase (random)', 100_000, randomWords, stringCamelCase);
performance('stringCamelCase (NFTOrder)', 100_000, [['NFTOrder']], stringCamelCase);
perf('stringCamelCase (random)', 100_000, randomWords, stringCamelCase);
perf('stringCamelCase (NFTOrder)', 100_000, [['NFTOrder']], stringCamelCase);
});
+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 { stringLowerFirst } from '.';
describe('stringLowerFirst', (): void => {
@@ -35,5 +35,5 @@ describe('stringLowerFirst', (): void => {
).toBe('');
});
performance('stringLowerFirst', 1_000_000, [['HelloWorldSomething']], stringLowerFirst);
perf('stringLowerFirst', 1_000_000, [['HelloWorldSomething']], stringLowerFirst);
});
+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 { stringUpperFirst } from '.';
describe('stringUpperFirst', (): void => {
@@ -35,5 +35,5 @@ describe('stringUpperFirst', (): void => {
).toBe('');
});
performance('stringUpperFirst', 1_000_000, [['helloWorldSomething']], stringUpperFirst);
perf('stringUpperFirst', 1_000_000, [['helloWorldSomething']], stringUpperFirst);
});