Use higher time resolution when available in os.nim (#7709)

This commit is contained in:
Oscar Nihlgård
2018-06-04 14:56:56 +02:00
committed by Andreas Rumpf
parent 440212a154
commit 05b447374b
4 changed files with 55 additions and 19 deletions

View File

@@ -42,6 +42,7 @@ Raises
true
true
true
true
'''
"""
# test os path creation, iteration, and deletion
@@ -129,3 +130,12 @@ echo fileExists("../dest/a/b/file.txt")
echo fileExists("../dest/a/b/c/fileC.txt")
removeDir("../dest")
# Test get/set modification times
# Should support at least microsecond resolution
import times
let tm = fromUnix(0) + 100.microseconds
writeFile("a", "")
setLastModificationTime("a", tm)
echo getLastModificationTime("a") == tm
removeFile("a")