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

linuxÏÂͳ¼Æʱ¼äÀà

class CTimeTickCount
{
public:
CTimeTickCount(int threadIndex, int id )
{
struct timezone tz;
gettimeofday(&m_tvStartTime, &tz);
// m_tmStartTime = ACE_OS::gettimeofday();
m_iThreadIndex = threadIndex;
m_iID = id;
}

~CTimeTickCount()
{
struct timezone tz;
struct timeval tv;
gettimeofday(&tv, &tz);

// ACE_Time_Value currTime = ACE_OS::gettimeofday();
long cost = (tv.tv_sec - m_tvStartTime.tv_sec) * 1000 * 1000;
cost += (tv.tv_usec - m_tvStartTime.tv_usec );

if(cost >= 100 * 1000 )
{
//NVS_DEBUG((NVS_LM_ERROR, "====thread no: %d, cost time: %dms, id: %d.",
// m_iThreadIndex, cost, m_iID));
printf( "====thread no: %d, cost time: %dms, id: %d.\n", m_iThreadIndex, cost, m_iID));
}
}

private:
struct timeval m_tvStartTime; // ACE_Time_Value m_tmStartTime; // ¿ªÊ¼Ê±¼ä
int m_iThreadIndex; // Ï̺߳Å
int m_iID; // ±êʾ
};


Ïà¹ØÎĵµ£º

Linux repair filesystemÎÊÌâµÄ½â¾ö°ì·¨

    ¹«Ë¾ÓÐ̨ÔËÐÐCentOS5.3µÄµçÄÔ½ñÔçÆô¶¯µÄʱºòÒ»Ö±Ìáʾ#repair filesystem 1ϵͳÎļþË𻵣¬ÐèÒªÐÞ¸´£¬È»¶øʹÓÃfsckÐÞ¸´ÁË°ëÌ컹ÊÇÎÞ·¨½øÈëXWindow¡£ÕâʱÎÒÐèÒªÓÃÓÅÅÌ¿½±´ÀïÃ漸¸öÎļþ£¬Ë÷ÐÔµ½ÃüÁîÐÐshellÖп½±´µÃÁË¡£¿ÉÊǽøÈ¥mountÉ豸µÄʱºòÈ´ÌáʾÎÒ£ºÏµÍ³ÎļþĿ¼ֻ¶Á£¬ÎÞ·¨´´½¨¹Ò½ÓÉ豸Îļþ......Ôõô° ......

Linux ¾²Ì¬Ó붯̬Á´½Ó¿â

ÎÄÕÂÑ¡È¡µÄÀý×ӷdz£¼òµ¥£¬ÉÏÊÖÈÝÒ×£¬Ö»ÊÇΪÁ˽²Êö¾²Ì¬Ó붯̬Á´½Ó¿âµÄÉú³ÉºÍÁ´½Ó¹ý
    ³Ì£¬»¹ÓÐËûÃÇÖ®¼äµÄÇø±ð¡£ÒÔÏÂÀý×ÓÔÚ gcc 4.1.1 ÏÂ˳Àûͨ¹ý¡£ 
ÎļþÔ¤ÀÀ
ÎļþĿ¼Ê÷ÈçÏ£¬ÈçÄãËù¼û£¬·Ç³£¼òµ¥¡£
libtest/  
|-- lt.c  
|-- lt.h  
`-- test. ......

Linux °²×°Èí¼þ ͨÓ÷½·¨


°²×°ÊµÀý£ºImageMagickµÄ°²×°·½·¨
ImageMagickµÄ°²×°·½·¨ÓÐRPM·½Ê½ºÍSOURCE·½Ê½¡£Ä¿Ç°×îаæÊÇImageMagick-6.5.5¡£¿ÉÒÔ´ÓÕâ¸öÍøÖ·ÏÂÔØ£º http://www.imagemagick.org
°²×°²½Ö裺
£±£®sshÁ¬½ÓLinux·þÎñÆ÷
£²£®°ÑÏÂÔصݲװÎļþ·Åµ½Êʵ±µÄÎļþ¼ÐÏ¡£ÀýÈ磺cd /usr/local/src¡£»òÕßÖ±½ÓÔÚ·þÎñÆ÷ÉÏÏÂÔØ¡£
3£®½âѹÏÂÔØÎļ ......

Linux²é¿´Îļþ¼Ð´óСµÄÃüÁî

[root@ns1 opt]#  du -h -s /* | sort
12K     /mnt
13M     /sbin
16K     /lost+found
1.8G    /usr
194M    /root
22G     /opt
24K     /tmp
4.0K&n ......

linux ²éÕÒÖ´ÐгÌÐòµÄµ±Ç°Â·¾¶

linux shell pwd ÏÔʾµ±Ç°Â·¾¶
¼ÙÈôÓÐtest.cpp
g++ test.cpp -o test
./test
ÏëÔÚtestÖÐÕÒµ½µ±Ç°Ö´ÐгÌÐòËùÔڵķ¾¶
¿ÉÒÔÔÙtest.cppÖÐʹÓÃreadlinkº¯Êý
¾ßÌå¼ûÈçÏÂʵÀý£º
#include<iostream>
#include<unistd.h>
#include<dirent.h>
#include<string.h>
#include<string>
using ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ