v / vlib / v2 / tests / module_storage_example / state / state.vv2
18 lines · 14 sloc · 259 bytes · ed1549f6808d68defe18fc93b8940ef1e8aaf004
Raw
1module state
2
3__global mut private_ticks = 0
4pub __global mut total_ticks = 0
5
6fn bump_private() {
7 private_ticks += 1
8}
9
10pub fn tick() int {
11 bump_private()
12 total_ticks += 1
13 return private_ticks
14}
15
16pub fn private_tick_count() int {
17 return private_ticks
18}
19