Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

elapsed time function() {math javascript

function calculate() {
    let start = Date.now();

    for (let count = 0; count < 100000; count++) {
        dice = Math.ceil(Math.random() * 6);
    }

    let elapsed = Date.now() - start;

    document.getElementById("lesstime").innerHTML = "The elapsed time was " + elapsed + " milleseconds. ";
}
 
PREVIOUS NEXT
Tagged: #elapsed #time #javascript
ADD COMMENT
Topic
Name
4+9 =