We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02c8a95 commit 9dec787Copy full SHA for 9dec787
src/utils.jl
@@ -530,24 +530,12 @@ the trailing edge, pass `trailing=true`.
530
```jldoctest
531
julia> a = Flux.throttle(() -> println("Flux"), 2);
532
533
-julia> a()
534
-Flux
535
-
536
-julia> for i = 1:4 # sleeps for 1 second -> the function can be called in alternate iterations
+julia> for i = 1:4 # a called in alternate iterations
537
a()
538
- sleep(1.5)
+ sleep(1)
539
end
540
Flux
541
542
543
-julia> for i = 1:4 # sleeps for 2 second -> the function can be called in the next iteration
544
- a()
545
- sleep(2)
546
- end
547
548
549
550
551
```
552
"""
553
function throttle(f, timeout; leading=true, trailing=false)
0 commit comments