2006-02-03 04:15:26

by Conio sandiago

[permalink] [raw]
Subject: time function behaving strane

Hi all,
i am using time function in my application.
When i call the try function in a loop of say 1 lac iterations then i
m facing strange behaviour.

What i am doing is that i am making a call twice to time function
inside every iteration and i compare the time of both the calls.
But sometimes the time obtained from recent call is 1 second less than
the previous call.

Has anybody observed such kind of problem??


2006-02-03 19:19:37

by john stultz

[permalink] [raw]
Subject: Re: time function behaving strane

On Fri, 2006-02-03 at 09:45 +0530, Conio sandiago wrote:
> Hi all,
> i am using time function in my application.
> When i call the try function in a loop of say 1 lac iterations then i
> m facing strange behaviour.
>
> What i am doing is that i am making a call twice to time function
> inside every iteration and i compare the time of both the calls.
> But sometimes the time obtained from recent call is 1 second less than
> the previous call.
>
> Has anybody observed such kind of problem??

Time inconsistencies are possible with some hardware, although full
second inconsistencies are a bit large.

Please open a bug at http://bugzilla.kernel.org

Attach a full dmesg log and assign it to me.

thanks
-john


2006-02-03 19:30:19

by Thomas Gleixner

[permalink] [raw]
Subject: Re: time function behaving strane

On Fri, 2006-02-03 at 11:19 -0800, john stultz wrote:
> On Fri, 2006-02-03 at 09:45 +0530, Conio sandiago wrote:
> > Hi all,
> > i am using time function in my application.
> > When i call the try function in a loop of say 1 lac iterations then i
> > m facing strange behaviour.
> >
> > What i am doing is that i am making a call twice to time function
> > inside every iteration and i compare the time of both the calls.
> > But sometimes the time obtained from recent call is 1 second less than
> > the previous call.
> >
> > Has anybody observed such kind of problem??
>
> Time inconsistencies are possible with some hardware, although full
> second inconsistencies are a bit large.
>
> Please open a bug at http://bugzilla.kernel.org
>
> Attach a full dmesg log and assign it to me.

Please provide also test code which makes that problem visible.

tglx