Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

times(2) Linux man page

Name
times - get process times
Synopsis
#include <sys/times.h>
clock_t times(struct tms *buf);
Description
times() stores the current process times in the
struct tms that buf points to. The struct tms is as defined
in <sys/times.h>
:
struct tms {
clock_t tms_utime; /* user time */
clock_t tms_stime; /* system time */
clock_t tms_cutime; /* user time of children */
clock_t tms_cstime; /* system time of children */
};
The tms_utime field contains the CPU time spent executing
instructions of the calling process. The tms_stime field contains the CPU
time spent in the system while executing tasks on behalf of the calling process.
The tms_cutime field contains the sum of the tms_utime and
tms_cutime values for all waited-for terminated children. The
tms_cstime field contains the sum of the tms_stime and
tms_cstime values for all waited-for terminated children.
Times for terminated children (and their descendants) is added in at the
moment wait(2) or waitpid(2) returns their process ID. In particular,
times of grandchildren that the children did not wait for are never seen.
All times reported are in clock ticks.
Return Value
times() returns the number of
clock ticks that have elapsed since an arbitrary point in the past. For Linux
2.4 and earlier this point is the moment the system was booted. Since Linux 2.6,
this point is (2^32/HZ) - 300 (i.e., about 429 million) seconds before
system boot time. The return value may overflow the possible range of type
clock_t. On error, (clock_t) -1 is returned, and errno is
set appropriately.
Notes
The number of clock ticks per second can be obtained using
sysconf(_SC_CLK_TCK);
In POSIX-1996 the symbol CLK_TCK
(defined in <time.h>) is
mentioned as obsolescent. It is obsolete now.
In Linux kernel versions before 2.6.9, if the disposition of SIGCHLD
is set to SIG_IGN then the times of terminated children are automatically
included in the tms_cstime


Ïà¹ØÎĵµ£º

Linux µÄ¶àÏ̱߳à³ÌµÄ¸ßЧ¿ª·¢¾­Ñé

2009 Äê 4 ÔÂ 23 ÈÕ
±¾ÎÄÖÐÎÒÃÇÕë¶Ô Linux É϶àÏ̱߳à³ÌµÄÖ÷ÒªÌØÐÔ×ܽá³ö 5 Ìõ¾­Ñ飬ÓÃÒÔ¸ÄÉÆ Linux ¶àÏ̱߳à³ÌµÄϰ¹ßºÍ±ÜÃâÆäÖеĿª·¢ÏÝÚå¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃÇ´©²åһЩ Windows µÄ±à³ÌÓÃÀýÓÃÒÔ¶Ô±È Linux ÌØÐÔ£¬ÒÔ¼ÓÉî¶ÁÕßÓ¡Ïó¡£
±³¾°
Linux ƽ̨ÉϵĶàÏ̳߳ÌÐò¿ª·¢Ïà¶ÔÓ¦ÆäËûƽ̨£¨±ÈÈç Windows£©µÄ¶àÏß³Ì API ÓÐһЩϸ΢ ......

LinuxÖеÄwaitϵͳµ÷ÓÃ

ϵͳÖеĽ©Ê¬½ø³Ì¶¼ÒªÓÉwaitϵͳµ÷ÓÃÀ´»ØÊÕ£¬ÏÂÃæ¾Íͨ¹ýʵս¿´Ò»¿´waitµÄ¾ßÌåÓ÷¨£º
waitµÄº¯ÊýÔ­ÐÍÊÇ£º
#include <sys/types.h> /* ÌṩÀàÐÍpid_tµÄ¶¨Òå */
#include <sys/wait.h>
pid_t wait(int *status);
½ø³ÌÒ»µ©µ÷ÓÃÁËwait£¬¾ÍÁ¢¼´×èÈû×Ô¼º£¬ÓÉwait×Ô¶¯·ÖÎöÊÇ·ñµ±Ç°½ø³ÌµÄij¸ö×Ó½ø³ÌÒѾ­Í˳ö£¬Èç¹ûÈ ......

linux¿ª»ú×Ô¶¯ÔËÐÐÉèÖÃ

ÔÚÍøÉÏ¿´µ½ÓÐÈË×ܽáµÃ²»´í
1£®¿ª»úÆô¶¯Ê±×Ô¶¯ÔËÐгÌÐò 
Linux
¼ÓÔØºó, Ëü½«³õʼ»¯Ó²¼þºÍÉ豸Çý¶¯, È»ºóÔËÐеÚÒ»¸ö½ø³Ìinit¡£init¸ù¾ÝÅäÖÃÎļþ¼ÌÐøÒýµ¼¹ý³Ì£¬Æô¶¯ÆäËü½ø³Ì¡£Í¨³£Çé¿öÏ£¬Ð޸ķÅÖÃ
ÔÚ /etc/rc»ò /etc/rc.d »ò /etc/rc?.d Ä¿Â¼ÏµĽű¾Îļþ£¬¿ÉÒÔʹinit×Ô¶¯Æô¶¯Æ ......

ÈÃlinuxÖ§³Ögbk±àÂë


ÍøÉÏ¿´µ½µ½µÄ·½·¨£¬¼Ç¼ÒÔ±¸Óá£
ÔÚÓ¢ÎÄLocaleϵÄUbuntu
ÎÞ·¨Õý³£ÏÔʾXPÏÂGBK±àÂëµÄÖÐÎÄ
±à¼­/etc/environmentÎļþ
Ìí¼ÓLC_CTYPE="zh_CN.GBK"Ò»ÐÐ
ÈçÏÂ:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
LANG="en_US.UTF-8"
LANGU ......

¼¸¸öÖØÒªµÄlinuxÎÄÕµØÖ·

http://www.ic37.com/htm_tech/2008-1/7319_150547.htm
http://www.lupaworld.com/26540/viewspace-114142.html
http://www.lupaworld.com/viewnews-17909.html
http://www.lupaworld.com/26540/viewspace-117210.html
http://www.lupaworld.com/26540/spacelist-blog-itemtypeid-2105.html
http://www.lupaworld.com/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ