int get_current_time(char *buf)
{
struct tm *tmnow;
struct timeval tv;
gettimeofday(&tv,NULL);
tmnow = localtime(&tv.tv_sec);
sprintf(buf,"%04d/%02d/%02d %02d:%02d:%02d.%6d",
tmnow->tm_year+1900, tmnow->tm_mon+1, tmnow->tm_mday,tmnow->tm_hour,
tmnow->tm_min, tmnow->tm_sec,tv.tv_usec);
return tv.tv_sec;
}