[Javascript] How quick is quick ?

Allard Schripsema allard-schripsema at procergs.rs.gov.br
Tue Nov 9 11:32:44 CST 2004


var now1
function Performance(description){
	var now2 = new Date()
	var miliSecs=now2.getTime()-now1.getTime()
	alert ( "JavaScript: "+description+"\n"+miliSecs/1000+" seconds. ")
}
now1 = new Date()
//Execute loop of whatever you want to test
Performance("TEST LOOP 1")

now1 = new Date()
//Execute loop of whatever you want to test
Performance("TEST LOOP 2")

now1 = new Date()
//Execute loop of whatever you want to test
Performance("TEST LOOP 3")

There is always a penalty for the loop that starts, so test with different
orders too!




-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu]On Behalf Of Tim Makins
Sent: Tuesday, November 09, 2004 2:36 PM
To: [JavaScript List]
Subject: [Javascript] How quick is quick ?


A few comments recently about how this will take time, and how that will be
really slow.

It would be nice to know exactly - has anyone got a routine that monitors
the time a javascript routine takes to operate ??

Tim in Ireland.

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list