easylogger/src/elog_port.c
/**
 * get current time interface
 *
 * @return current time
 */
get current time interface
@return current time
get current time interface @return current time
const char *elog_port_get_time(void) {
    static char cur_system_time[24] = { 0 };
    int len;
    struct timeval tv;
    struct tm cur_tm;
    gettimeofday(&tv, NULL);
    localtime_r(&tv.tv_sec, &cur_tm);
    len = strftime(cur_system_time, sizeof(cur_system_time), "%m-%d %T", &cur_tm);
    cur_system_time[len] = '-';
    int msec = tv.tv_usec / 1000;
    sprintf(cur_system_time + len + 1, "%03d", msec);
    return cur_system_time;
}
const char * elog_port_get_time ( void ) { static char cur_system_time [ 24 ] = { 0 } ; int len ; struct timeval tv ; struct tm cur_tm ; gettimeofday ( & tv , NULL ) ; localtime_r ( & tv . tv_sec , & cur_tm ) ; len = strftime ( cur_system_time , sizeof ( cur_system_time ) , " " , & cur_tm ) ; cur_system_time [ len ] = ' ' ; int msec = tv . tv_usec / 1000 ; sprintf ( cur_system_time + len + 1 , " " , msec ) ; return cur_system_time ; }
get current time interface
 @return current time
get current time interface @return current time