Skip to content

Commit 89e5374

Browse files
README: Have different tasks run at different speeds so they don't all finish at the same time, which in turn would produce all progress updates at once
1 parent eba7892 commit 89e5374

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

OVERVIEW.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The functions in the [**plyr**](https://cran.r-project.org/package=plyr) package
112112
library(progressr)
113113
with_progress({
114114
y <- plyr::l_ply(1:5, function(x, ...) {
115-
Sys.sleep(1)
115+
Sys.sleep(6.0-x)
116116
sqrt(x)
117117
}, .progress = "progressr")
118118
})
@@ -140,7 +140,7 @@ with_progress({
140140
p <- progressr::progressor(5)
141141
y <- future_lapply(1:5, function(x, ...) {
142142
p(sprintf("x=%g", x))
143-
Sys.sleep(1)
143+
Sys.sleep(6.0-x)
144144
sqrt(x)
145145
})
146146
})
@@ -164,7 +164,7 @@ with_progress({
164164
p <- progressr::progressor(5)
165165
y <- foreach(x = 1:5) %dopar% {
166166
p(sprintf("x=%g", x))
167-
Sys.sleep(1)
167+
Sys.sleep(6.0-x)
168168
sqrt(x)
169169
}
170170
})

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The functions in the [**plyr**](https://cran.r-project.org/package=plyr) package
114114
library(progressr)
115115
with_progress({
116116
y <- plyr::l_ply(1:5, function(x, ...) {
117-
Sys.sleep(1)
117+
Sys.sleep(6.0-x)
118118
sqrt(x)
119119
}, .progress = "progressr")
120120
})
@@ -142,7 +142,7 @@ with_progress({
142142
p <- progressr::progressor(5)
143143
y <- future_lapply(1:5, function(x, ...) {
144144
p(sprintf("x=%g", x))
145-
Sys.sleep(1)
145+
Sys.sleep(6.0-x)
146146
sqrt(x)
147147
})
148148
})
@@ -166,7 +166,7 @@ with_progress({
166166
p <- progressr::progressor(5)
167167
y <- foreach(x = 1:5) %dopar% {
168168
p(sprintf("x=%g", x))
169-
Sys.sleep(1)
169+
Sys.sleep(6.0-x)
170170
sqrt(x)
171171
}
172172
})

0 commit comments

Comments
 (0)