diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index d60e8a2486..5221646f15 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -996,8 +996,9 @@ def run(self, **inputs): runtime = self._run_interface(runtime) outputs = self.aggregate_outputs(runtime) runtime.endTime = dt.isoformat(dt.utcnow()) - runtime.duration = (parseutc(runtime.endTime) - - parseutc(runtime.startTime)).total_seconds() + timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime) + runtime.duration = timediff.days * 86400 + timediff.seconds + \ + timediff.microseconds/100000. results = InterfaceResult(interface, runtime, inputs=self.inputs.get_traitsfree(), outputs=outputs) @@ -1005,8 +1006,9 @@ def run(self, **inputs): results.provenance = prov_record except Exception, e: runtime.endTime = dt.isoformat(dt.utcnow()) - runtime.duration = (parseutc(runtime.endTime) - - parseutc(runtime.startTime)).total_seconds() + timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime) + runtime.duration = timediff.days * 86400 + timediff.seconds + \ + timediff.microseconds/100000. if len(e.args) == 0: e.args = ("")