mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +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);
|
|
});
|
|
});
|