Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cpuMeasurement = function (timeFrame) { // timeFrame in milliseconds
- var cpum = 0;
- var start = new Date().getTime();
- var end = new Date().getTime();
- while (end - start < timeFrame) {
- cpum++;
- end = new Date().getTime();
- }
- return cpum;
- };
- console.log(cpuMeasurement(20));
Add Comment
Please, Sign In to add comment