We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa510f5 commit a6df8d0Copy full SHA for a6df8d0
src/compas_fab/robots/time_.py
@@ -19,8 +19,11 @@ class Duration(object):
19
"""
20
21
def __init__(self, secs, nsecs):
22
- self.secs = int(secs)
23
- self.nsecs = int(nsecs)
+ sec_to_nano_factor = 1e9
+ quotient, remainder = divmod(secs, 1)
24
+
25
+ self.secs = int(quotient)
26
+ self.nsecs = int(remainder*sec_to_nano_factor) + int(nsecs)
27
28
def __str__(self):
29
return 'Duration({!r}, {!r})'.format(self.secs, self.nsecs)
0 commit comments