2020-05-01 14:48:00 +03:00
|
|
|
module main
|
|
|
|
|
2020-05-03 18:59:11 +03:00
|
|
|
// Build this example with `v -live message.v`
|
2019-07-07 22:46:21 +03:00
|
|
|
import time
|
2021-01-16 16:05:01 +03:00
|
|
|
import v.live
|
2019-07-07 22:46:21 +03:00
|
|
|
|
2019-09-21 21:38:12 +03:00
|
|
|
[live]
|
2019-07-07 22:46:21 +03:00
|
|
|
fn print_message() {
|
2020-05-03 18:59:11 +03:00
|
|
|
info := live.info()
|
|
|
|
println('OK reloads: ${info.reloads_ok:4d} | Total reloads: ${info.reloads:4d} | Hello! Modify this message while the program is running.')
|
2019-07-07 22:46:21 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
for {
|
|
|
|
print_message()
|
2021-02-27 20:41:06 +03:00
|
|
|
time.sleep(500 * time.millisecond)
|
2019-07-07 22:46:21 +03:00
|
|
|
}
|
|
|
|
}
|