[uClibc] clock() for long-running process

Atsushi Nemoto anemo at mba.ocn.ne.jp
Mon May 10 15:08:17 UTC 2004


>>>>> On Mon, 10 May 2004 16:15:49 +0200, "Joakim Tjernlund" <joakim.tjernlund at lumentis.se> said:

tjernlund> Suppose times() wrap to a negative value between t1 and
tjernlund> t2. Then you have:
tjernlund> diff = t2 - t1 = -x(t2) - y(t1) = < 0, right?

In this case, negative overflow will happen.

  t1: 2147483647 (0x7fffffff)
  t2: -2147483648 (0x80000000)
  diff = t2 - t1 = 1

No magic :-)

---
Atsushi Nemoto



More information about the uClibc mailing list