Skip to content

Instantly share code, notes, and snippets.

@valeriu
Last active December 12, 2015 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valeriu/4745148 to your computer and use it in GitHub Desktop.
Save valeriu/4745148 to your computer and use it in GitHub Desktop.
Exercice 27 (5)
<!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