diff options
author | rrt <unknown> | 2000-04-06 17:54:01 +0000 |
---|---|---|
committer | rrt <unknown> | 2000-04-06 17:54:01 +0000 |
commit | f84b2a908a8fd897f80e290a3814dc17dd4ea727 (patch) | |
tree | b4f9f7865fc4097025354013d7172f22cc21a2a3 /ghc/lib/std/cbits/getCPUTime.c | |
parent | 24a808a66d06bd2c7b32a5734866021b2b566922 (diff) | |
download | haskell-f84b2a908a8fd897f80e290a3814dc17dd4ea727.tar.gz |
[project @ 2000-04-06 17:54:01 by rrt]
Fixed getCPUTime for Windows, which was seriously broken (arithmetically,
logically &c. &c.).
showTime now calls tzset under Cygwin just as timezone.c does.
Diffstat (limited to 'ghc/lib/std/cbits/getCPUTime.c')
-rw-r--r-- | ghc/lib/std/cbits/getCPUTime.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ghc/lib/std/cbits/getCPUTime.c b/ghc/lib/std/cbits/getCPUTime.c index 512aa573e6..34f1b378af 100644 --- a/ghc/lib/std/cbits/getCPUTime.c +++ b/ghc/lib/std/cbits/getCPUTime.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: getCPUTime.c,v 1.6 1999/09/30 15:50:02 sof Exp $ + * $Id: getCPUTime.c,v 1.7 2000/04/06 17:54:01 rrt Exp $ * * getCPUTime Runtime Support */ @@ -155,11 +155,11 @@ getCPUTime(StgByteArray cpuStruct) FT2usecs(uT, userTime); FT2usecs(kT, kernelTime); - + cpu[0] = (unsigned int)(uT / NS_PER_SEC); - cpu[1] = (unsigned int)(uT * 100); - cpu[0] = (unsigned int)(kT / NS_PER_SEC); - cpu[1] = (unsigned int)(kT * 100); + cpu[1] = (unsigned int)((uT - cpu[0] * NS_PER_SEC) * 100); + cpu[2] = (unsigned int)(kT / NS_PER_SEC); + cpu[3] = (unsigned int)((kT - cpu[2] * NS_PER_SEC) * 100); return 1; } |