mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-03-03 04:10:38 +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
|
||||
id*: uint
|
||||
when defined(chronosFutureDuration):
|
||||
startTime*: Moment
|
||||
duration*: Duration
|
||||
startTime: Moment
|
||||
duration: Duration
|
||||
|
||||
when defined(chronosStackTrace):
|
||||
errorStackTrace*: StackTrace
|
||||
@ -1047,3 +1047,8 @@ proc race*(futs: varargs[FutureBase]): Future[FutureBase] =
|
||||
|
||||
retFuture.cancelCallback = cancellation
|
||||
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