2020-05-01 11:48:00 +00:00
|
|
|
module main
|
|
|
|
|
2020-05-03 15:59:11 +00:00
|
|
|
// Build this example with `v -live message.v`
|
2019-07-07 19:46:21 +00:00
|
|
|
import time
|
2021-01-16 13:05:01 +00:00
|
|
|
import v.live
|
2019-07-07 19:46:21 +00:00
|
|
|
|
2019-09-21 18:38:12 +00:00
|
|
|
[live]
|
2019-07-07 19:46:21 +00:00
|
|
|
fn print_message() {
|
2020-05-03 15:59:11 +00: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 19:46:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
for {
|
|
|
|
print_message()
|
2021-02-27 17:41:06 +00:00
|
|
|
time.sleep(500 * time.millisecond)
|
2019-07-07 19:46:21 +00:00
|
|
|
}
|
|
|
|
}
|