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; // ±êʾ
};
Ïà¹ØÎĵµ£º
Ç°ÃæÔÚÒ»¸öÏîÄ¿¿ª·¢ÖÐÓõ½ÁËImageMagick£¬ÎÒÃÇ×Ô¼ºµÄ²âÊÔ»·¾³¶¼Õý³££¬È»ºó¾Í°´ÕÕÎÒÃÇ¿ª·¢»·¾³µÄ°²×°·½·¨°²×°Á˿ͻ§µÄ²âÊÔ»·¾³£¬µ«ÔÚ´¦ÀíjpegÀàÐÍͼƬµÄʱºò±¨´íÁË¡£»ØÍ·Ò»¿´ÅäÖÃlog£¬¾ÓÈ»²»Ö§³Öjpeg¡£
ImageMagick ÊDZ任ͼƬµÄ¿âȺ£¬Ö§³Öperl£¬C++£¬JAVAµÈµÈÓïÑÔ¡£¿ÉÒ ......
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 ......
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <s ......
/***********************************
*
*client.c
*
**********************************/
#include<stdio.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<sys/socket.h>
#include<sy ......