Last active
December 12, 2015 08:38
-
-
Save valeriu/4745148 to your computer and use it in GitHub Desktop.
Exercice 27 (5)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>05</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var suma = 0; | |
var timpul; | |
var n1 = new Date().getTime(); | |
for (i=1;i<=1000000;i++) | |
{ | |
suma = suma +i; | |
//if (suma % 100000 == 0) document.write(suma+"<br>") | |
} | |
var n2 = new Date().getTime(); | |
timpul = n2-n1; | |
document.write("Nombre approximatif de millisecondes : "+timpul); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment