mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-08 19:21:28 +00:00
add performance
This commit is contained in:
parent
2f93d81eed
commit
c68561d87d
@ -67,3 +67,17 @@ export class GildedRose {
|
|||||||
return this.items;
|
return this.items;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const startTime = performance.now();
|
||||||
|
|
||||||
|
// Call the function
|
||||||
|
const gildedRose = new GildedRose([]);
|
||||||
|
gildedRose.updateQuality();
|
||||||
|
|
||||||
|
// Record end time
|
||||||
|
const endTime = performance.now();
|
||||||
|
|
||||||
|
// Calculate the time difference
|
||||||
|
const timeTaken = endTime - startTime;
|
||||||
|
|
||||||
|
console.log(`myFunction took ${timeTaken.toFixed(2)} ms to execute.`);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user