mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-03-03 20:30:39 +00:00
fixup: make field private, add public accessor
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
3fbc74525d
commit
7d4c8a4287
@ -44,8 +44,8 @@ type
|
|||||||
mustCancel*: bool
|
mustCancel*: bool
|
||||||
id*: uint
|
id*: uint
|
||||||
when defined(chronosFutureDuration):
|
when defined(chronosFutureDuration):
|
||||||
startTime*: Moment
|
startTime: Moment
|
||||||
duration*: Duration
|
duration: Duration
|
||||||
|
|
||||||
when defined(chronosStackTrace):
|
when defined(chronosStackTrace):
|
||||||
errorStackTrace*: StackTrace
|
errorStackTrace*: StackTrace
|
||||||
@ -1047,3 +1047,8 @@ proc race*(futs: varargs[FutureBase]): Future[FutureBase] =
|
|||||||
|
|
||||||
retFuture.cancelCallback = cancellation
|
retFuture.cancelCallback = cancellation
|
||||||
return retFuture
|
return retFuture
|
||||||
|
|
||||||
|
when defined(chronosFutureDuration):
|
||||||
|
func duration*(future: FutureBase): Duration =
|
||||||
|
## Duration between future start and finish
|
||||||
|
future.duration
|
||||||
|
Loading…
x
Reference in New Issue
Block a user