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

Linux»ñÈ¡ºÁÃ뼶ʱ¼ä


Linux»ñÈ¡ºÁÃ뼶ʱ¼ä
Moakap
ÔÚÈí¼þÉè¼ÆÖо­³£»áÓõ½¹ØÓÚʱ¼äµÄ´¦Àí£¬ÓÃÀ´¼ÆËãÓï¾ä¡¢º¯ÊýµÄÖ´ÐÐʱ¼ä£¬Õâʱ¾ÍÐèÒª¾«È·µ½ºÁÃëÉõÖÁÊÇ΢ÃîµÄʱ¼ä¡£
 
int gettimeofday(struct
timeval *tv, struct timezone *tz);
int settimeofday(const
struct timeval *tv , const struct timezone *tz);
 
struct timeval {
   
time_t      tv_sec;     /* seconds */
   
suseconds_t tv_usec;    /*
microseconds */
};
 
struct timezone {
   
int tz_minuteswest;     /* minutes
west of Greenwich
*/
    int
tz_dsttime;         /* type of DST
correction */
};
 
ÏÂÃæÊǸö¼òµ¥µÄÀý×Ó£¬ÓÃÀ´Í³¼Æ³ÌÐòµÄÖ´ÐÐʱ¼ä£º
       …
struct timeval
t_start,t_end;
   
long cost_time = 0;
 
//get start
time
gettimeofday(&t_start,
NULL);
printf("Start
time: %ld us", t_start.tv_usec);
 
//some
operation

 
//get end time
gettimeofday(&t_end,
NULL);
printf("End
time: %ld us", t_end.tv_usec);
 
//calculate
time slot
cost_time =
t_end.tv_usec - t_start.tv_usec;
printf("Cost
time: %ld us", cost_time);

 
Êä³ö£º
Start time:
438061 us
End time:
459867 us
Cost time:
21806 us


Ïà¹ØÎĵµ£º

LinuxÐÂÊÖÒªÁ˽âµÄÊ®¸ö֪ʶµã

LinuxÐÂÊÖÒªÁ˽âµÄÊ®¸ö֪ʶµã
¡¡¡¡1.LinuxÊÇ´óСдÃô¸ÐµÄϵͳ£¬¾Ù¸öÀý×Ó£¬Mozilla, MOZILLA, mOzillaºÍ mozillaÊÇËĸö²»Í¬µÄÃüÁµ«ÊÇÖ»ÓеÚËĸömozillaÊÇÕæÕýÓÐЧµÄÃüÁ¡£»¹ÓУ¬my_filE, my_file,ºÍ my_FILEÊÇÈý¸ö²»Í¬µÄÎļþ¡£Óû§µÄµÇ¼ÃûºÍÃØÃÜÒ²ÊÇ´óСдÃô¸ÐµÄ£¨ÕâÊÇÒòΪUNIXϵͳºÍCÓïÑԵĴ«Í³Ò»ÏòÊÇ´óСдÃô¸ÐËùÖ ......

linuxÖгö´í´¦Àí

linuxÖУ¬ÔÚÖ§³Ö¶àÏ̵߳Ļ·¾³ÖУ¬Í¨³£Ã¿¸öÏ̶߳¼ÓÐÊôÓÚ×Ô¼ºµÄerrno±äÁ¿£¬ÊÇÓÃÀ´±íÊ¾ÌØ¶¨´íÎóµÄ³£Á¿¡£
ÒÔÏÂÊÇ<errno.h>Öж¨ÒåµÄËùÓгö´íerrno³£Á¿
#define EPERM            1      /* Operation not permitted */
#define ENOEN ......

LinuxÖеÄÄÚ´æ·ÖÅäºÍÊÍ·ÅÖ®free_bootmem()º¯Êý·ÖÎö

  free_bootmem()Õâ¸öº¯ÊýÊÇϵͳÆô¶¯³õÆÚÄÚ´æÊͷŵĺËÐĺ¯Êý£¬ÎÒÃÇÀ´¿´¿´ËüµÄ´úÂë¡£
  void __init free_bootmem (unsigned long addr, unsigned long size)//addrÊÇÒªÊͷŵÄÎïÀíÆðʼµØÖ·£¬sizeÊÇÒªÊͷſռäµÄ´óС¡£
 {
    free_bootmem_core(NODE_DATA(0)->bdata, addr, size);//Ö±½ ......

/etc/hosts file in linux configure manual

Name
hosts - The static table lookup for host names
Synopsis
/etc/hosts
Description
This manual page describes the format of the /etc/hosts
file. This file is a simple text file that
associates IP addresses with hostnames, one line per IP address. For
each host a single line should be presen ......

linux frame buffer grab

linuxµÄÇý¶¯¾ÍÊǸö×Ö·ûÉ豸£¬¿ÉÒÔÓÃread write ioctl mmap²Ù×÷£¬Í¨¹ý/dev/fbx¿ÉÒÔÏñÎļþÒ»ÑùÖ±½Ó¶Áд
½ØÆÁdd if=/dev/fb0 of=snapshot
»Ö¸´cat snapshot > /dev/fb0
¿ªÔ´µÄÓÐfbgrab¹¤¾ß£¬²»¹ýÊÇÉú³ÉpngÎļþ£¬ÎÒ×Ô¼ºÐ´ÁËÒ»¸öÉú³ÉbmpÎļþµÄ¹¤¾ß½Ðfbcap£¬Â¼ÖƳÉavi¸ñʽ£¬Í¨¹ýsocket»òserial°ÑÉ豸µÄ²Ù×÷·¢Ë͵½hostÉÏ£º£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ