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

24 lines
263 B
V
Raw Normal View History

2019-07-07 22:46:21 +03:00
// Build this example with
// v -live message.v
2019-07-07 22:46:21 +03:00
module main
import os
2019-07-07 22:46:21 +03:00
import time
[live]
2019-07-07 22:46:21 +03:00
fn print_message() {
println('Hello! Modify this message while the program is running.')
2019-07-07 22:46:21 +03:00
}
fn main() {
os.clear()
2019-07-07 22:46:21 +03:00
for {
print_message()
time.sleep_ms(500)
2019-07-07 22:46:21 +03:00
}
}