struct timezone tz;
struct timeval stHandleHistoryRecordFactlyStartTime;
struct timeval stHandleHistoryRecordFactlyEndTime;
gettimeofday(&stHandleHistoryRecordFactlyStartTime,&tz);
dosomething();//处理一些函数的时间
gettimeofday(&stHandleHistoryRecordFactlyEndTime,&tz);
int iHandleHistoryRecordFactlyTime = (stHandleHistoryRecordFactlyEndTime.tv_sec - stHandleHistoryRecordFactlyStartTime.tv_sec)*1000 + (stHandleHistoryRecordFactlyEndTime.tv_usec - stHandleHistoryRecordFactlyStartTime.tv_usec)/1000;
则 iHandleHistoryRecordFactlyTime就是间隔时间