mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: no longer use printf in the coroutines example
This commit is contained in:
parent
0810e84098
commit
e55175fcaa
@ -8,8 +8,8 @@ import net.http
|
|||||||
|
|
||||||
fn foo(a int) {
|
fn foo(a int) {
|
||||||
for {
|
for {
|
||||||
// println('hello from foo()') // a=${a}')
|
println('1hello from foo() a=${a}')
|
||||||
C.printf(c'hello from foo() a=%d\n', a)
|
//C.printf(c'hello from foo() a=%d\n', a)
|
||||||
coroutines.sleep(1 * time.second)
|
coroutines.sleep(1 * time.second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -17,8 +17,8 @@ fn foo(a int) {
|
|||||||
fn foo2(a int) {
|
fn foo2(a int) {
|
||||||
mut i := 0
|
mut i := 0
|
||||||
for {
|
for {
|
||||||
// println('hello from foo2()') // a=${a}')
|
println('hello from foo2() a=${a}')
|
||||||
C.printf(c'hello from foo2() a=%d\n', a)
|
//C.printf(c'hello from foo2() a=%d\n', a)
|
||||||
coroutines.sleep(2 * time.second)
|
coroutines.sleep(2 * time.second)
|
||||||
i++
|
i++
|
||||||
// resp := http.get('https://vlang.io/utc_now') or { panic(err) }
|
// resp := http.get('https://vlang.io/utc_now') or { panic(err) }
|
||||||
@ -32,16 +32,16 @@ fn foo2(a int) {
|
|||||||
|
|
||||||
fn foo3(a int) {
|
fn foo3(a int) {
|
||||||
for {
|
for {
|
||||||
// println('hello from foo3()') // a=${a}')
|
println('hello from foo3() a=${a}')
|
||||||
C.printf(c'hello from foo3() a=%d\n', a)
|
//C.printf(c'hello from foo3() a=%d\n', a)
|
||||||
coroutines.sleep(3 * time.second)
|
coroutines.sleep(3 * time.second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn foo4(a int) {
|
fn foo4(a int) {
|
||||||
for {
|
for {
|
||||||
// println('hello from foo4()') // a=${a}')
|
println('hello from foo4() a=${a}')
|
||||||
C.printf(c'hello from foo4() a=%d\n', a)
|
//C.printf(c'hello from foo4() a=%d\n', a)
|
||||||
coroutines.sleep(3 * time.second)
|
coroutines.sleep(3 * time.second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user