1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: time.wait() => time.sleep()

This commit is contained in:
Alexander Medvednikov
2021-02-27 20:41:06 +03:00
parent be4a2e17d3
commit 3a2d696fac
42 changed files with 76 additions and 67 deletions

View File

@@ -36,6 +36,6 @@ fn main() {
os.system('git push origin gh-pages')
os.chdir('..')
}
time.wait(60 * time.second)
time.sleep(60 * time.second)
}
}

View File

@@ -44,7 +44,7 @@ fn (mut ctx Context) println(s string) {
fn do_timeout(c &Context) {
mut ctx := c
time.wait(ctx.timeout_ms * time.millisecond)
time.sleep(ctx.timeout_ms * time.millisecond)
exit(ctx.exitcode)
}
@@ -76,7 +76,7 @@ fn main() {
go do_timeout(&ctx)
for i := 1; true; i++ {
ctx.println('$i')
time.wait(ctx.period_ms * time.millisecond)
time.sleep(ctx.period_ms * time.millisecond)
}
time.wait(100 * time.second)
time.sleep(100 * time.second)
}

View File

@@ -60,7 +60,7 @@ fn main() {
source = source[..context.cut_index]
go fn (ms int) {
time.wait(ms * time.millisecond)
time.sleep(ms * time.millisecond)
exit(ecode_timeout)
}(context.timeout_ms)
_ := parser.parse_text(source, context.path, context.table, .skip_comments, context.pref,
@@ -259,7 +259,7 @@ fn (mut context Context) start_printing() {
fn (mut context Context) stop_printing() {
context.stop_print = true
time.wait(time.millisecond * context.period_ms / 5)
time.sleep(time.millisecond * context.period_ms / 5)
}
fn (mut context Context) print_status() {
@@ -284,7 +284,7 @@ fn (mut context Context) print_periodic_status() {
for !context.stop_print {
context.print_status()
for i := 0; i < 10 && !context.stop_print; i++ {
time.wait(time.millisecond * context.period_ms / 10)
time.sleep(time.millisecond * context.period_ms / 10)
if context.cut_index > 50 && !printed_at_least_once {
context.print_status()
printed_at_least_once = true