startTrans(); $data = array(); } $data[] = array( 'DeviceId' => $deive_id + $i, 'DeviceTime' => $start_time, 'Longitude' => 120 + rand(200001,220562)/1000000, 'Latitude' => 30 + rand(260001,260818)/1000000, 'Speed' => rand(0, 40), 'Direction' => rand(1,8), 'Status' => rand(1,10), 'SatelliteCount' => rand(4,11), 'LBS' => 'abcdefgh' ); if( $i % 1200 == 0 ){ $gps->addAll($data); $gps->commit(); $end_submit = microtime(true); var_dump('now ' . $i .' use ' . ($start_submit - $end_submit) .' memory_get_usage :' . memory_get_usage()); } } usleep(1000); $start_time ++; } echo '['.date('Y-m-d H:i:s').'] ———————————————————— create route finished ———————————————————— '.PHP_EOL; } }