Example #1
0
 public function test_1Action()
 {
     $model = TestModel::model();
     $starttime = explode(' ', microtime());
     for ($i = 0; $i < 1000; $i++) {
         $data = $model->where('id', $i)->page(1, 4)->get();
     }
     debug($data);
     //程序运行时间
     $endtime = explode(' ', microtime());
     $thistime = $endtime[0] + $endtime[1] - ($starttime[0] + $starttime[1]);
     $thistime = round($thistime, 3);
     echo "本网页执行耗时:" . $thistime . " 秒。" . time();
     echo 'hello world';
 }