怎么去写双击后做某件事情呢?

怎么去写双击后做某件事情呢?

if(oldTouchTime - currentTouchTime < 1 )

this.scheduleOnce(xx, 0.3);
0.3秒清除点击状态。