timer(v){
let func = v;
let that = this;
if(timerId != undefined){
that.clearTimeout(timerId);
}
let timerId = setTimeout(function tick() {
func();
timerId = setTimeout(tick, 500);
}, 500);
}
timer(v){
let func = v,
timerId = null;
if (timerId) {
clearInterval(timerId);
}
timerId = setInterval(function tick() {
func();
}, 500);
}