Re: [master] Make loader log time with milliseconds (part of #524980).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -37,33 +38,35 @@ static FILE * file_logfile = NULL;
>  static int minLevel = INFO;
>  
>  static void printLogHeader(int level, FILE *outfile) {
> -    time_t current_time = time(NULL);
> -    struct tm *t = gmtime (&current_time);
> +    struct timeval current_time;
> +    gettimeofday(&current_time, NULL);
> +    struct tm *t = gmtime(&current_time.tv_sec);
> +    int msecs = current_time.tv_usec / 1000;

Stylistically, I like putting all the variable declarations before
places where we start using them, but I guess now I'm just being really
picky.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux