summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-laptop>2010-05-30 21:15:20 +0200
committerAndreas Rumpf <andreas@andreas-laptop>2010-05-30 21:15:20 +0200
commit909f7dbf8cac95d4cdb08c4a2e1cb4ba2d42bfeb (patch)
tree69348060582d89e2535bdce154f4a4d9655962e4 /lib/pure
parentcb21b0e7a789bc068a177258b20b6b4333651c2a (diff)
downloadNim-909f7dbf8cac95d4cdb08c4a2e1cb4ba2d42bfeb.tar.gz
revert to old behavior of getStartMilsecs; getStartMilsecs deprecated
Diffstat (limited to 'lib/pure')
-rwxr-xr-xlib/pure/times.nim14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index da712263d..144a6eb4f 100755
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -139,7 +139,7 @@ proc `<=` * (a, b: TTime): bool =
   ## returns true iff ``a <= b``.
   result = a - b <= 0
 
-proc getStartMilsecs*(): int
+proc getStartMilsecs*(): int {.deprecated.}
   ## get the miliseconds from the start of the program
 
 
@@ -212,15 +212,15 @@ when not defined(ECMAScript):
   proc getStartMilsecs(): int =
     #echo "clocks per sec: ", clocksPerSec, "clock: ", int(clock())
     #return clock() div (clocksPerSec div 1000)
-    when defined(posix):
-      var a: Ttimeval
-      posix_gettimeofday(a)
-      result = a.tv_sec * 1000 + a.tv_usec
+    when defined(macosx):
+      result = toInt(toFloat(clock()) / (toFloat(clocksPerSec) / 1000.0))
     else:
       result = int(clock()) div (clocksPerSec div 1000)
     when false:
-      when defined(macosx):
-        result = toInt(toFloat(clock()) / (toFloat(clocksPerSec) / 1000.0))
+      var a: Ttimeval
+      posix_gettimeofday(a)
+      result = a.tv_sec * 1000 + a.tv_usec
+      #echo "result: ", result
     
   proc getTime(): TTime = return timec(nil)
   proc getLocalTime(t: TTime): TTimeInfo =
>176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288