Skip to content

Commit e18c81b

Browse files
Merge pull request #72 from tiagocoutinho/fix-timeval-set_ns
Fix timeval set_ns to use given value
2 parents b9ca9e7 + e706b91 commit e18c81b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linuxpy/ctypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class timeval(Struct):
9191
def set_ns(self, value=None):
9292
if value is None:
9393
value = time.time_ns()
94-
microsecs = time.time_ns() // NANOSEC_PER_MICROSEC
94+
microsecs = value // NANOSEC_PER_MICROSEC
9595
self.secs = microsecs // MICROSEC_PER_SEC
9696
self.usecs = microsecs % MICROSEC_PER_SEC
9797

0 commit comments

Comments
 (0)