How to setup timer resolution to 0.5 ms?

前端 未结 5 1557
北荒
北荒 2021-01-03 03:44

I want to set a machine timer resolution to 0.5ms.

Sysinternal utility reports that the min clock resolution is 0.5ms so it can be done.

P.S. I know how to

5条回答
  •  我在风中等你
    2021-01-03 04:47

    If you use python, I wrote a library named wres, which calls NtSetTimerResolution internally.

    pip install wres

    import wres
    
    # Set resolution to 0.5 ms (in 100-ns units)
    # Automatically restore previous resolution when exit with statement
    with wres.set_resolution(5000):
        pass
    

提交回复
热议问题