Skip to content

Commit

Permalink
fixup: make field private, add public accessor
Browse files Browse the repository at this point in the history
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
  • Loading branch information
cskiraly committed Jul 7, 2023
1 parent 2f66813 commit 8323faf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chronos/asyncfutures2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 8323faf

Please sign in to comment.