mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 10:45:08 +03:00
16 lines
381 B
TypeScript
16 lines
381 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { sample as sampleToolkit } from 'es-toolkit';
|
|
import { sample as sampleLodash } from 'lodash';
|
|
|
|
describe('sample', () => {
|
|
bench('es-toolkit/sample', () => {
|
|
const array = [1, 2, 3, 4, 5];
|
|
sampleToolkit(array);
|
|
});
|
|
|
|
bench('lodash/sample', () => {
|
|
const array = [1, 2, 3, 4, 5];
|
|
sampleLodash(array);
|
|
});
|
|
});
|