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