FREE LINK
TOP OFFERS
QUALITY LINKS
TOP LINKS
BEST FREE LINKS
it is a good description of the operation of DHTML.

Foundations De Benchmarking

In Javascript the easiest way to the test pattern its code is using Date the object. Date The object has a method very called practitioner getTime(), who returns the number of the milliseconds that have happened from of January the 1 of 1970. This is useful to make any Arithmetic of the date, as the synchronization how its code is working quickly, and forms the base of which you can test pattern your uses of AJAX. For example:

var date = new Date();
var start = date.getTime();
//    do stuff here.
var end = date.getTime();
//    notify the user
alert(end - start);

The first shade that the revealers work generally in here is that getTime() the method returns the date in milliseconds but or the operation is often simply too fast (and perhaps nonworthy of the around then preoccupation) or browser will tend to return factors from ten that make any hard thing underneath 10ms measure. Ambo, and the fact that the results tend to vary between the tests, means that it is good practice to repeat his tests several times to obtain a mean deviation and of standard.

Another limitation of the Javascript benchmarking is that if the taking of the tests to the amount of considerable time browser solicits generally that the writing is aborted. This can be avoided to a certain degree using setTimeout() the function to initiate any bow of the code. Also setTimeout() using lets browser bring up to date any change to the using interface as to eliminate errors or information of process. Using of the example setTimeout() is demonstrated here:

//    global variables
var g_time = [];
var g_iteration = 0;
var g_maxIterations = 0;

function DoTest()
{
var start = new Date().getTime();
//    do stuff here.
var end = new Date().getTime();
//    save time
g_time.push(end - start);
if (g_iteration > g_maxIterations)
    return;
g_iteration++;
setTimeout(DoTest);
}

Using getTime() is a good way to go on benchmarking during the development or any exploratory work. Nevertheless, when it comes to prove a product can be very useful to apply something more substantial for example).

Before AJAX, it was accepted generally that most of the tasks made in the Javascript would be quite small that the revealers really do not need to worry about editions of the operation. On the other hand, in the world of today of the maps of AJAX and the photo to share this can be a critical error. Saying that, I do not hope that each one to escurr and to mop its Javascript in the search of the potential optimizations that will shave yellow- some milliseconds of his descoloran "." The Javascript is generally quite fast that you can construct your program and after refactoring any obvious turnpikes must work rather quickly.

Queen

Related Reading

clock of rolex
100 extremities and tools of Industrial-Fuerza
By Common Selection

Content
Index

The Safari reads In line --
Look for this book in safari:
 

Only base fragments

Pages: 1, 2

Following Page


Related Articles:

AJAX That fixes: Harmful XMLHttpRequest Consideraba
Jason Levitt demonstrates to us how to work around the restrictions of XmlHttpRequest to obtain more joy of services of third person of the fabric.

It is AJAX to remain here?
The takings of the frank letter of Jordan a glance of high level in way AJAX are changing the Web and if it is a technology that is going to stick around.

Scripting moved away with AJAX, part 2
In part one of this bipartite series, Cameron Adams created a use of the example that demonstrated how to use scripting remote to put the protocol of AJAX in XMLHttpRequest execution. Now, in part two, he demonstrates how to create a U.S.ABLE interface by the example app.



Sponsored He surrounds:


Éntrenos in contact with  | Our Mission | Policy De Aislamiento | Announce With Us | | Guidelines Of the Submissions
Means © 2006, Inc. De ÓReilly Of The Copyright.
sitemap | index