make epochTime available in DLLs; refs #6855
This commit is contained in:
parent
3ef727adfe
commit
9aa6aa6514
1 changed files with 49 additions and 50 deletions
|
|
@ -2484,8 +2484,7 @@ when not defined(JS):
|
||||||
var
|
var
|
||||||
clocksPerSec {.importc: "CLOCKS_PER_SEC", nodecl, used.}: int
|
clocksPerSec {.importc: "CLOCKS_PER_SEC", nodecl, used.}: int
|
||||||
|
|
||||||
when not defined(useNimRtl):
|
proc cpuTime*(): float {.tags: [TimeEffect].} =
|
||||||
proc cpuTime*(): float {.rtl, extern: "nt$1", tags: [TimeEffect].} =
|
|
||||||
## gets time spent that the CPU spent to run the current process in
|
## gets time spent that the CPU spent to run the current process in
|
||||||
## seconds. This may be more useful for benchmarking than ``epochTime``.
|
## seconds. This may be more useful for benchmarking than ``epochTime``.
|
||||||
## However, it may measure the real time instead (depending on the OS).
|
## However, it may measure the real time instead (depending on the OS).
|
||||||
|
|
@ -2510,7 +2509,7 @@ when not defined(JS):
|
||||||
else:
|
else:
|
||||||
result = toFloat(int(getClock())) / toFloat(clocksPerSec)
|
result = toFloat(int(getClock())) / toFloat(clocksPerSec)
|
||||||
|
|
||||||
proc epochTime*(): float {.rtl, extern: "nt$1", tags: [TimeEffect].} =
|
proc epochTime*(): float {.tags: [TimeEffect].} =
|
||||||
## gets time after the UNIX epoch (1970) in seconds. It is a float
|
## gets time after the UNIX epoch (1970) in seconds. It is a float
|
||||||
## because sub-second resolution is likely to be supported (depending
|
## because sub-second resolution is likely to be supported (depending
|
||||||
## on the hardware/OS).
|
## on the hardware/OS).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue