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
2021-02-27 20:41:06 +03:00

19 lines
359 B
V

module main
// Build this example with `v -live message.v`
import time
import v.live
[live]
fn print_message() {
info := live.info()
println('OK reloads: ${info.reloads_ok:4d} | Total reloads: ${info.reloads:4d} | Hello! Modify this message while the program is running.')
}
fn main() {
for {
print_message()
time.sleep(500 * time.millisecond)
}
}