|
|

楼主 |
发表于 2005-10-13 11:08:17
|
显示全部楼层
1, I just count the mozilla opening time, it takes about 4~5 seconds to open a page.
2, I add some printf command to see the time used, it seems like:
begin to fork() Thu Oct 13 10:43:16 2005
Thu Oct 13 10:43:16 2005 return 0 //can not open, seems like no response
begin to fork() Thu Oct 13 10:44:12 2005
Thu Oct 13 10:44:12 2005 return 0 //can not open, seems like no response
begin to fork() Thu Oct 13 10:44:42 2005
Thu Oct 13 10:44:42 2005 return 0 //opened
The code is:
int exRet = 0;
cur_time = time(NULL);
strncpy (buffer, ctime(&cur_time),24);
printf("begin to fork() %s \n", buffer);//current time
if ((pid = fork ()) < 0) {
perror ("fork");
exit (1);
} else if (pid == 0) { /* child process */
int fd = open ("/dev/null", O_WRONLY);
if (fd < 0) {
perror ("open /dev/null");
} else {
if (dup2 (fd, 1) < 0 || dup2 (fd, 2)) {
perror ("dup2");
}
}
exRet = //return value of execl
execl (help_browser,
help_browser,
helppage_path,
NULL);
}
cur_time = time(NULL);
strncpy (buffer, ctime(&cur_time),24);
printf(" %s return %d \n", buffer, exRet);
另外,很少的机会,mozilla打开的时间并不长,但是多数情况下,第一次运行时,需要较长的时间,而且有时没有相应,只能重新点击。 |
|