cv
unread,Feb 20, 2009, 9:34:41 PM2/20/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to kiwiphp
我是一个新手,看到kiwiphp 的跑Hello World这样的应用是原生PHP的63% 这个特色我觉得非常好奇,创建了一个文件测试了一下
kiwiphp。
我使用普通的计算时间的方法来测试
<?php
$kiwiHome = dirname(dirname(dirname(__FILE__)));
include($kiwiHome . '/runtime/kiwi.php');
$projDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$memory_start = @memory_get_usage();
$time_start = microtime(TRUE);
Kiwi::run(array(
'proj_dir' => $projDir,
'app_name' => 'first_app',
));
echo round((microtime(TRUE) - $time_start)*1000, 4), 'ms*1000 ',
(memory_get_usage()-$memory_start), 'b<br />';
$time_start = microtime(TRUE);$memory_start = @memory_get_usage();
class HelloWorldAction1
{
public function execute()
{
return true;
}
}
$obj = new HelloWorldAction1();
$obj->execute();
echo round((microtime(TRUE) - $time_start)*1000, 4), 'ms*1000 ',
(memory_get_usage()-$memory_start), 'b';
输出结果是:
52.4721ms*1000 712272b
0.016ms*1000 0b
是我的测试方法有问题吗?