ets:update_counter实现数字循环

首先初始化为1 

ets:insert(?MODULE, {seq, 1}), 

ets:update_counter(e, seq, {2,1,8,1}).

 

1

145> ets:update_counter(e, seq, {2,1,4,1}).

2

146> ets:update_counter(e, seq, {2,1,4,1}).

3

147> ets:update_counter(e, seq, {2,1,4,1}).

4

148> ets:update_counter(e, seq, {2,1,4,1}).

1

149> ets:update_counter(e, seq, {2,1,4,1}).

2

 

你可能感兴趣的:(update)