lkml.org 
[lkml]   [2006]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch 3/6] statistics infrastructure - prerequisite: timestamp
Balbir Singh wrote:
>> +static inline int nsec_to_timestamp(char *s, unsigned long long t)
>> +{
>> + unsigned long nsec_rem = do_div(t, 1000000000);
>
> Could we please use NSEC_PER_SEC. I cannot count the number of zeros
> after the 1.

Sure. I tried to keep my changes as small as possible ;-)

>> + return sprintf(s, "[%5lu.%06lu]", (unsigned long)t,
>> nsec_rem/1000);
>> +}
>
> Something symbolic for the 1000 would be better. NSECS_PER_USEC probably?

Makes sense.

Thanks,
Martin


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-23 15:36    [W:0.691 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site