code Execution time in nodejs

// Import the 'performance' module from Node.js
const { performance } = require('perf_hooks');

// Record the starting time
const start = performance.now();

// Your code to measure execution time goes here
// For example, a simple loop
for (let i = 0; i < 1000000; i++) {
    // Your code logic here
}

// Record the ending time
const end = performance.now();

// Calculate the execution time in milliseconds
const executionTime = end - start;

// Print the execution time
console.log(`Execution time: ${executionTime} milliseconds`);