Hey folks, I've been trying to figure out how to performance test my JavaScript code, and I could use some help.

I've got a specific piece of code that I want to optimize. Here's the code snippet I'm working with:

<script>
function calculateSum(n) {
let sum = 0;
for (let i = 1; i <= n; i++) {
sum += i;
}
return sum;
}
</script>

This function calculates the sum of integers from 1 to n. Now, I want to find out how efficient it is, especially for large values of n.

Any suggestions on how I can measure its performance, and what tools or techniques I should use for this?