Skip to content

Commit

Permalink
Merge pull request #337 from yha/progress-update-timing
Browse files Browse the repository at this point in the history
Move update of progress to occur after the iteration.
  • Loading branch information
pfitzseb authored Aug 2, 2019
2 parents 73cb766 + 5853838 commit 1f5faaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/progress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ function _progress(name, thresh, ex, target, result, loop, iter_vars, ranges, bo

$(loop(iter_exprs,
quote
val = $body
frac = _frac($(Expr(:vect, count_vars...)))
if frac - lastfrac > $thresh
@logmsg($PROGRESSLEVEL, $(esc(name)), progress=frac, _id=Symbol($_id))
lastfrac = frac
end
$body
val
end
))

Expand Down

0 comments on commit 1f5faaf

Please sign in to comment.