Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { performance } = require('perf_hooks');
- const start = performance.now();
- // Escrever um array de string com 1000 elementos no console
- const arr = new Array(1000).fill().map((_, i) => `linha ${i+1}`);
- console.log(arr);
- const end = performance.now();
- const timeInSeconds = ((end - start) / 1000).toFixed(6);
- console.log(`Tempo de execução: ${timeInSeconds} segundos`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement