Newer
Older
Php-rpc / test / make-rpc.php
  1. <?php
  2.  
  3. include __DIR__."/../src/sysVcom.php";
  4. include __DIR__."/../src/time.php";
  5.  
  6.  
  7. $some_arr = array(
  8. 'key_1' => 3.14159,
  9. 'key_2' => "pony"
  10. );
  11.  
  12. $cnt = 10000;
  13. $st_time = (float)getTimeAsString(1733051170);
  14. for( $i=0; $i<$cnt; $i++){
  15. $obj = rpc( 'myFunct', 34, 4.9e-7, $some_arr );
  16. }
  17. //print_r( $obj );
  18. $en_time = (float)getTimeAsString(1733051170);
  19.  
  20. echo "done\n\n";
  21. echo (($en_time-$st_time)/$cnt) . "\n\n";
  22.  
  23. // timed on a laptop (1.9GHz, 2-core, 4-threads) at 30uS per rpc call-return
  24. // including a short array object
  25.  
  26. ?>