/    Sign up×
Community /Pin to ProfileBookmark

Help with page timer?

Okay, I have a little javascript function at the top and near the bottom of my pages that gets the current date.

Right now im just using these to get both variables: new Date() .getTime()

At the end of the page it subtracts the two to get how long it took to load the page. Problem is that it doesnt match up with the Fasterfox extension (I only use it for the timer). Im guessing its not doing things like images as its always something like this:

Page: 0.847
Fasterfox: 3.526

I was wondering if there was a better way to do this in javascript. Ive tried searching all over but all I get is PHP, and it has to be Client Side. (its a free host, dont have access to the server, but im fine with that ? )

Thanks in advance.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@SaikuronauthorMay 28.2007 — bump

Any ideas? Evan a "somewhat correct time is not possible in JS" from a knowledgeable member would help too.

Oh and the quick equation to get the seconds (maybe thats whats wrong). Both variables use the new Date() .getTime() in the places I pointed out above.

var seconds = ((tstart - tend)/1000).toFixed(4);

Page generated in: 0.847 seconds.
×

Success!

Help @Saikuron spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...