diff --git a/module/common/model.php b/module/common/model.php index d58c3ec7ae..47984c159f 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -504,23 +504,6 @@ class commonModel extends model helper::end(); } - /** - * 输出运行信息。 - * Print the run info. - * - * @param mixed $startTime the start time. - * @access public - * @return array the run info array. - */ - public function printRunInfo($startTime) - { - $info['timeUsed'] = round(getTime() - $startTime, 4) * 1000; - $info['memory'] = round(memory_get_peak_usage() / 1024, 1); - $info['querys'] = count(dbh::$queries); - vprintf($this->lang->runInfo, $info); - return $info; - } - /** * 格式化日期,将日期格式化为YYYY-mm-dd,将日期时间格式化为YYYY-mm-dd HH:ii:ss。 * Format the date to YYYY-mm-dd, format the datetime to YYYY-mm-dd HH:ii:ss. diff --git a/module/common/test/model/printruninfo.php b/module/common/test/model/printruninfo.php deleted file mode 100644 index cf6cccdd87..0000000000 --- a/module/common/test/model/printruninfo.php +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env php -printRunInfo(); -timeout=0 -cid=0 - -- 测试运行时间。属性timeUsed @10000 -- 测试查询的sql次数。属性querys @40 -- 测试运行时间。属性timeUsed @100000 -- 测试查询的sql次数。属性querys @40 -- 测试运行时间。属性timeUsed @1000000 -- 测试查询的sql次数。属性querys @40 - -*/ -include dirname(__FILE__, 5) . '/test/lib/init.php'; - -su('admin'); - -global $tester; -$tester->loadModel('common'); - -ob_start(); -$result1 = $tester->common->printRunInfo(getTime() - 10); -$result2 = $tester->common->printRunInfo(getTime() - 100); -$result3 = $tester->common->printRunInfo(getTime() - 1000); -ob_end_clean(); -r($result1) && p('timeUsed') && e('10000'); // 测试运行时间。 -r($result1) && p('querys') && e('40'); // 测试查询的sql次数。 -r($result2) && p('timeUsed') && e('100000'); // 测试运行时间。 -r($result2) && p('querys') && e('40'); // 测试查询的sql次数。 -r($result3) && p('timeUsed') && e('1000000'); // 测试运行时间。 -r($result3) && p('querys') && e('40'); // 测试查询的sql次数。