diff options
author | Oscar Campbell <oscar@campbell.nu> | 2015-06-07 13:16:08 +0200 |
---|---|---|
committer | Oscar Campbell <oscar@campbell.nu> | 2015-06-07 13:16:08 +0200 |
commit | 858cdd0b05df4846fb40a3263f05e54438995e99 (patch) | |
tree | 939fb5e27650e4e7a24698b3c3dac5acada396b1 /lib/pure/concurrency/cpuload.nim | |
parent | 87a6d08e95c940775577c8f2bc5a74408c956a89 (diff) | |
parent | bbb1bdb4a939aa43ed981acc2f96bce918be7d21 (diff) | |
download | Nim-858cdd0b05df4846fb40a3263f05e54438995e99.tar.gz |
Merge remote-tracking branch 'upstream/devel' into devel
Diffstat (limited to 'lib/pure/concurrency/cpuload.nim')
-rw-r--r-- | lib/pure/concurrency/cpuload.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/concurrency/cpuload.nim b/lib/pure/concurrency/cpuload.nim index 1f3f54056..22598b5c9 100644 --- a/lib/pure/concurrency/cpuload.nim +++ b/lib/pure/concurrency/cpuload.nim @@ -13,7 +13,7 @@ when defined(windows): import winlean, os, strutils, math - proc `-`(a, b: TFILETIME): int64 = a.rdFileTime - b.rdFileTime + proc `-`(a, b: FILETIME): int64 = a.rdFileTime - b.rdFileTime elif defined(linux): from cpuinfo import countProcessors @@ -25,16 +25,16 @@ type ThreadPoolState* = object when defined(windows): - prevSysKernel, prevSysUser, prevProcKernel, prevProcUser: TFILETIME + prevSysKernel, prevSysUser, prevProcKernel, prevProcUser: FILETIME calls*: int proc advice*(s: var ThreadPoolState): ThreadPoolAdvice = when defined(windows): var sysIdle, sysKernel, sysUser, - procCreation, procExit, procKernel, procUser: TFILETIME + procCreation, procExit, procKernel, procUser: FILETIME if getSystemTimes(sysIdle, sysKernel, sysUser) == 0 or - getProcessTimes(Handle(-1), procCreation, procExit, + getProcessTimes(Handle(-1), procCreation, procExit, procKernel, procUser) == 0: return doNothing if s.calls > 0: @@ -57,7 +57,7 @@ proc advice*(s: var ThreadPoolState): ThreadPoolAdvice = s.prevProcKernel = procKernel s.prevProcUser = procUser elif defined(linux): - proc fscanf(c: File, frmt: cstring) {.varargs, importc, + proc fscanf(c: File, frmt: cstring) {.varargs, importc, header: "<stdio.h>".} var f = open("/proc/loadavg") |