Ryccou | Merci voila j'obtient qqchose de cohérant, c génial, pour ceux que ca interesse :
Code :
- <script language="php">
- if($retour == 1)
- {
- exec("ifconfig", $list);
- $rep = trim($list[6]);
- $time2 = microtime();
- eregi("TX bytes:([0-9]{1,}) ",$rep,$rep2);
- $val2 = $rep2[1];
- $t1 = explode(" ",$time1);
- $t2 = explode(" ",$time2);
- $tps = ($t2[1].substr($t2[0],1,9)) - ($t1[1].substr($t1[0],1,9));
- $x = round((($val2 - $val1)/1024),2);
- print "$x ko en $tps secondes";
- print "<br>";
- print $vitesse = round(($x / $tps),2);
- print "ko/s";
- print "<br><br>";
- print "<br><br> <a href='$PHP_SELF'>Re-test</a>";
- }
- else
- {
- exec("ifconfig", $list);
- $rep = trim($list[6]);
- $start = microtime();
- eregi("TX bytes:([0-9]{1,}) ",$rep,$rep2);
- $val1 = $rep2[1];
- $now = microtime();
- //Calcul du temps d'exécution
- $t1 = explode(" ",$start);
- $t2 = explode(" ",$now);
- $tps = ($t2[1].substr($t2[0],1,9)) - ($t1[1].substr($t1[0],1,9));
- while($tps < 5)
- {
- $now = microtime();
- //Calcul du temps d'exécution
- $t1 = explode(" ",$start);
- $t2 = explode(" ",$now);
- $tps = ($t2[1].substr($t2[0],1,9)) - ($t1[1].substr($t1[0],1,9));
- }
- header("Location:$PHP_SELF?retour=1&val1=$val1&time1=$start" );
- }
- </script>
|
|