PDA

View Full Version : php microtime help (more or less a math problem)


Dr.CustUmz
04-16-2016, 05:50 PM
ANOTHER EDIT ***
I still dont think this is right, my math has shown it to be a nano second... can someone please help this is bugging me so bad.

ok deleted everything before this is seriously bugging me lol i have it looking good, but what good is appearance if i dont know what its meaning -_-

so i take (excuse if any typos it is working on the real version)
$pageloadstart = microtime(TRUE);
on one end, and on the other end
$pageloadstop = microtime(TRUE);

then I do
$pageloadtotal = $pageloadstop - $pageloadstart.' ?micro seconds?';

the result turns out to be a digit like this
0.048259973526001

what is this output... mili micro nano.... second



so if i times it by 1000 and only show 2 decimals so it displays as

48.26

what do i call this...
can i say its 48.26 milli seconds?

im so lost!

my logic behind my thinking is if i have 1,650,000$

i can say i have 1.65 million dollars...

need some help =/

--------------- Added 1460872683 at 1460872683 ---------------

$pageloadstop - $pageloadstart = 0.0482645645456465

number_format(($pageloadstop - $pageloadstart) * 1000, 2)

returns 48.26

this is the formula I cant figure out what type of second it is =/

Dave
04-17-2016, 05:11 AM
http://php.net/manual/en/function.microtime.php

microtime() returns the current Unix timestamp with microseconds. This function is only available on operating systems that support the gettimeofday() system call.

So if you divide it by 1000, it will be milliseconds.
What you're doing is converting it to nanoseconds.

Dr.CustUmz
04-17-2016, 01:29 PM
thats what my fiancee and i came up with too lol, but if a page is loading at

75.73 nano seconds

which is

0.00000008 seconds

or

0.00008 miliseconds

isnt that kind of fast?

what should a page load time be?

--------------- Added 1460907399 at 1460907399 ---------------

https://vborg.vbsupport.ru/external/2016/04/24.png

this server is sitting right next to my main pc, and are linked through the same router. That still seems like its not correct to me though. thats an awfully fast load time.