--- a/TimeDuration.st Mon Jul 23 11:17:43 2018 +0200
+++ b/TimeDuration.st Tue Jul 24 17:30:52 2018 +0200
@@ -746,29 +746,6 @@
"
!
-+ aTimeDurationOrNumberOfSeconds
- "return a new timeDuration.
- The argument may be a timeDuration or
- a number, which is interpreted as seconds."
-
- |newMillis newPicos|
-
- aTimeDurationOrNumberOfSeconds isNumber ifTrue:[
- newMillis := (self getMilliseconds + (aTimeDurationOrNumberOfSeconds * 1000) asInteger).
- newPicos := additionalPicoseconds ? 0.
- ] ifFalse:[
- newMillis := (self getMilliseconds + aTimeDurationOrNumberOfSeconds getMilliseconds).
- newPicos := (additionalPicoseconds ? 0) + (aTimeDurationOrNumberOfSeconds additionalPicoseconds).
- ].
- ^ self species basicNew
- setMilliseconds:newMillis additionalPicoseconds:newPicos
-
- "
- (TimeDuration fromString:'1m') + (TimeDuration fromString:'10s')
- 1 minutes + 10 seconds
- "
-!
-
- aTimeDurationOrNumberOfSeconds
"return a new timeDuration.
The argument may be a timeDuration or
@@ -948,10 +925,10 @@
this may return a non-integer value."
additionalPicoseconds isNil ifTrue:[
- ^ (timeEncoding) "/ millis
+ ^ timeEncoding "/ millis
].
- ^ (timeEncoding) "/ millis
- + (additionalPicoseconds / (1000 * 1000 * 1000)) "/ picos as milliseconds.
+ ^ timeEncoding "/ millis
+ + (additionalPicoseconds / (1000 * 1000 * 1000)) "/ picos as milliseconds.
"
40 milliseconds asExactMilliseconds
@@ -961,6 +938,7 @@
"
"Created: / 21-09-2017 / 18:52:26 / cg"
+ "Modified (format): / 24-07-2018 / 16:27:10 / Stefan Vogel"
!
asExactMinutes
@@ -1423,42 +1401,7 @@
"
! !
-!TimeDuration methodsFor:'double dispatching'!
-differenceFromTimestamp:aTimestamp
- "return the timestamp this timeDuration before aTimestamp"
-
- ^ aTimestamp speciesNew "/ to get the UTC-offset, if any
- setMilliseconds:(aTimestamp getMilliseconds - self getMilliseconds)
- additionalPicoseconds:(aTimestamp additionalPicoseconds - self additionalPicoseconds)
-!
-
-productFromNumber:aNumber
- "sent when an integer does not know how to multiply the receiver.
- Return a new timeDuration"
-
- ^ self species basicNew
- setMilliseconds:(self getMilliseconds * aNumber)
- additionalPicoseconds:((additionalPicoseconds?0) * aNumber)
-
- "
- 5.1 * (TimeDuration fromString:'10s')
- (TimeDuration fromString:'10s') * 5.1
-
- 5.1 * (TimeDuration fromString:'10ns')
- (TimeDuration fromString:'10ns') * 5.1
- "
-
- "Modified (comment): / 12-06-2017 / 20:50:51 / cg"
-!
-
-sumFromTimestamp:aTimestamp
- "return the timestamp this timeDuration after aTimestamp"
-
- ^ aTimestamp speciesNew "/ to get the UTC-offset, if any
- setMilliseconds:(self getMilliseconds + aTimestamp getMilliseconds)
- additionalPicoseconds:(self additionalPicoseconds + aTimestamp additionalPicoseconds)
-! !
!TimeDuration methodsFor:'printing'!