我发现timer控件最小只能计时1毫秒内的时间,我想在一毫秒内触发3个事件,那该怎么办呢?

解决方案 »

  1.   

    timer做不到,听说只能精确到10毫秒.
    用API吧
      

  2.   

    QueryPerformanceFrequency + QueryPerformanceCounter
      

  3.   

    用DateDiff试试,DateDiff可以控制到微秒级,比如你可以延时100us来触发一个事件:
        Dim tmpTime As Date
        tmpTime = Now '得到一个时间参照点
        'Dim counter As Double
        Do While DateDiff("s", tmpTime, Now) < 0.0001
            'counter = counter + 1
            DoEvents
        Loop
        'todo: 触发事件