473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Measuring time taken to run a script

I notice on
http://msdn.microsoft.com/library/de...dude100499.asp
that the writer has measured the time taken to run the script down to
the millisecond.

Does anyone know what tools he used to calculate these load times?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #1
1 2278
"Fabian" <la****@hotmail.com> wrote in message
news:bs************@ID-174912.news.uni-berlin.de...
I notice on [ ... ] that the writer has measured the
time taken to run the script down to the millisecond.

Does anyone know what tools he used to calculate these
load times?


Instances of the Date object, they do not produce millisecond values
with a precision of less than about 10 milliseconds (and that varies by
OS) so timing operations would usually involve repeating the operation
sufficiently often and then dividing the interval by the number of times
the operation was repeated. Possibly also calculating the overhead
involved in the actual testing, including the looping, and probably
repeating the tests to reduce the influence of background tasks on
multitasking OSs.

It probably doesn't make sense to talk of timing scripts (at least in an
event driven browser context), more likely functions or sets of (or
individual) operations.

I have found that a limiting factor in repeatedly executing the same
code in a loop is the browser's tendency to put up a dialog saying
something like "a script on this page is causing the browser to run
slowly", which renders any results meaningless. However, I tend to
increase the number of iterations of the tested code until that dialog
is reported (in the browsers that do so) and then drop back just under
that limit so the average timings are as representative as they can be.

The relative efficiency of various operations is often debated here so a
well-phrased groups.google.com search of c.l.j should turn up numerous
examples of test pages/scripts.

Richard.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Sims | last post by:
Hi, I recall a function that would tell me how long it took to generate an output. But for the life of me I cannot remember it. Dow anybody know it? Or do I have to write something myself,...
0
by: SimonC | last post by:
I'm looking to do something similar to a feature found on Ticketmaster.com, where you select your seats at a venue, and then you have two minutes in which to take or leave them. QUESTION 1a....
2
by: duane | last post by:
Dear Experts: I am trying to measure a HTML page download time on the client side and store the value into a textfile located in the server. I have successfully measured the page download time...
4
by: D. Alvarado | last post by:
Hello, I would like to design a page that measures the user's download connection. Does anyone have an example link or script that might aid me in this task? Thanks, - Dave
74
by: Dominik Wallner | last post by:
Hi! I'm currently implementing a program which measures voltages through an external USB-AD-converter. It should output those values as time/voltage pairs. My problem is to measure the time...
20
by: upperclass | last post by:
Hi, I'm trying to find a decent way of measuring the running time of a long-running program. Say, the running time ranges from several seconds to more than a day. The standard clock()...
3
by: sivaji | last post by:
Is there any function or variable that return the time taken to execute a part or full php script .
7
by: i12know | last post by:
Hi guys, I have tried a lot of code and read forums discussing about C or C++ functions that measures time in microsecond, but there still seems to be confusions about that. Can anyone tell me...
9
by: Ross | last post by:
I'm a newbie at this, and have searched a lot but can't find something that seems appropriate for measuring a recurring elapsed time. Creating an object with: var mydate = new Date(); seems...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.