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
Ïà¹ØÎĵµ£º
lsmod(list modules)
¹¦ÄÜ˵Ã÷£ºÏÔʾÒÑÔØÈëϵͳµÄÄ£¿é¡£
Óï¡¡¡¡·¨£ºlsmod
²¹³ä˵Ã÷£ºÖ´ÐÐlsmodÖ¸Á»áÁгöËùÓÐÒÑÔØÈëϵͳµÄÄ£¿é¡£Linux²Ù×÷ϵͳµÄºËÐľßÓÐÄ£¿é»¯µÄÌØÐÔ£¬Ó¦´ËÔÚ±àÒëºËÐÄʱ£¬ÎñÐë°ÑÈ«²¿µÄ¹¦Äܶ¼·ÅÈëºËÐÄ¡£Äú¿ÉÒÔ½«ÕâЩ¹¦ÄܱàÒë³ÉÒ»¸ö¸öµ¥¶ÀµÄÄ£¿é£¬´ýÐèҪʱÔÙ·Ö±ðÔØÈë¡£
·¶Àý£º
[root@lin ......
Q. How do I install Languages in Linux after installation? I don’t have any language specific support installed but need to install the same. I’m using both RHEL 5 and CentOS 5.
A. Yellow dog Updater, Modified, a package manager for RPM-compatible Linux systems such as Cento ......
linuxÖУ¬ÔÚÖ§³Ö¶àÏ̵߳Ļ·¾³ÖУ¬Í¨³£Ã¿¸öÏ̶߳¼ÓÐÊôÓÚ×Ô¼ºµÄerrno±äÁ¿£¬ÊÇÓÃÀ´±íÊ¾ÌØ¶¨´íÎóµÄ³£Á¿¡£
ÒÔÏÂÊÇ<errno.h>Öж¨ÒåµÄËùÓгö´íerrno³£Á¿
#define EPERM 1 /* Operation not permitted */
#define ENOEN ......
µ±´ÅÅÌ´óС³¬¹ý±ê׼ʱ»áÓб¨¾¯Ìáʾ£¬ÕâʱÈç¹ûÕÆÎÕdfºÍduÃüÁîÊǷdz£Ã÷ÖǵÄÑ¡Ôñ¡£
df¿ÉÒԲ鿴һ¼¶Îļþ¼Ð´óС¡¢Ê¹ÓñÈÀý¡¢µµ°¸ÏµÍ³¼°Æä¹ÒÈëµã£¬µ«¶ÔÎļþÈ´ÎÞÄÜΪÁ¦¡£
du¿ÉÒԲ鿴Îļþ¼°Îļþ¼ÐµÄ´óС¡£
Á½ÕßÅäºÏʹÓ㬷dz£ÓÐЧ¡£±ÈÈçÓÃdf²é¿´ÄĸöÒ»¼¶Ä¿Â¼¹ý´ó£¬È»º ......
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ÉÏ£º£ ......