Windows timer resolution tool in form of system service

Discussion in 'Operating Systems' started by mbk1969, Mar 23, 2013.

  1. mr1hm

    mr1hm Active Member

    Messages:
    97
    Likes Received:
    2
    GPU:
    2070 Super XC Ultra
    doh :bang:

    sorry im not very familiar with system timers but, if you don't mind, would you mind explaining a bit more on how they are not related?

    i thought i remembered disabling HPET in BIOS and Windows 7 because it was giving me CPU specific WHEA errors (e.g. machine check exception on processor 0). Do you think it was just due to the fact that my system timer was slowly desynchronizing itself when i had HPET enabled? :3eyes:

    appreciate the reply

    EDIT: The timer resolution seems to jump back and forth between 0.488ms and 0.500ms, not sure if this is a bad thing or good thing. Any explanations would be nice :)
     
    Last edited: May 20, 2013
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Here is topic on system timer
    http://forums.guru3d.com/showthread.php?t=377790

    HPET has nothing to do with system timer. It is high precision counter which Windows can use in implementation of its QueryPerformanceCounter() function. It was introduced to get rid of problematic behaviour (on old multicore systems) of QueryPerformanceCounter implemented on TSC. In new processors TSC is implemented correctly and is called Invariant TSC.
     
    Last edited: May 20, 2013
  3. Rapyer

    Rapyer Guest

    Messages:
    218
    Likes Received:
    2
    GPU:
    1080ti
    in case you couldnt get it to work.

    download v2 c# version, put it in c:\ directory. download the Install-STRService.ps1 script and out it in same directory at c:\

    click start button, search for powershell. run it as admin. type in

    Set-ExecutionPolicy unrestricted

    press enter.


    type in cd.. and enter a few times until you are at root directory.

    then type in ".\Install-STRService.ps1" and press r to run once.


    then type in Set-ExecutionPolicy restricted

    exit and check services.msc to see that it's running.
     
    akbaar likes this.
  4. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Well, you can check if it`s runnig right in PowerShell:

    get-service STR

    And it is not wise to install any software into the root folder.
     
    Last edited: May 21, 2013

  5. thth

    thth Guest

    Messages:
    5
    Likes Received:
    0
    GPU:
    680 sli
    Hello what is the difference between c++ and c# of version1?
    which one will use less cpu/resources?
     
  6. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Differences:
    - c++ version is build 32-bit executable and c# version is .Net assembly (which JIT-compiled on your rig at run time, and that makes c# version 'native' on all rigs);
    - c++ version uses MSVC runtime and c# version uses .Net runtime, and I suspect that MSVC runtime needs less RAM.

    Both versions do nothing except waiting for a common windows service notifications. Timer resolution is set at the start of service.
     
    Last edited: Oct 30, 2013
  7. thth

    thth Guest

    Messages:
    5
    Likes Received:
    0
    GPU:
    680 sli
    Yes I have noticed the c++ version use less ram (700kb vs 2.2mb). If they do nothing other than at the start up then its all good. Thanks for clearing up.
     
  8. Wanny

    Wanny Guest

    The service seems to have broke in 8.1. Is this correct?
     
  9. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    I don`t know. You have C# of C++ version? If C# then have you rebuilt service binary in current OS? Have you placed service binary into any system folder? Have you disabled drivers signature/sertificate checking?
    You can check whether API used for timer interval manipulations is supported by using any other app that does the same manipulations.

    Have you read Event viewer? This service writes events into Application branch. If service is failed to start then corresponding events should be in System branch.
     
    Last edited: Nov 9, 2013
  10. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Exceeded the mark of 2000 downloads... I am impressed and curious - whether any of those people achieved any improvement by using timer resolution tweak.
     

  11. bishi

    bishi Master Guru

    Messages:
    575
    Likes Received:
    17
    GPU:
    GTX 1080 SLI
    Well I've used it for a long time, I don't have numbers to back it up but I swear it was helping minimize microstutter on BF3 with SLI so I kept it :)
     
  12. Cyberdyne

    Cyberdyne Guest

    Messages:
    3,580
    Likes Received:
    308
    GPU:
    2080 Ti FTW3 Ultra
  13. pjokerxp

    pjokerxp Banned

    Messages:
    652
    Likes Received:
    0
    GPU:
    Palit GeForce GTX 680 2GB
  14. mootyful

    mootyful Member

    Messages:
    31
    Likes Received:
    4
    GPU:
    GTX 760 Gigabyte
    Really nice. I have a problem though. I'm stuck at 1.250 even after uninstalling. If installed it works perfect at 0.500, but I can't seem to revert it back to 15.600.
     
  15. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    That means only one thing - some process requested 1.25 ms timer resolution.
    Uninstallation doesn`t needed for timer resolution to revert to previous value, because reversion takes place when process requested resolution is stopped.
     

  16. mootyful

    mootyful Member

    Messages:
    31
    Likes Received:
    4
    GPU:
    GTX 760 Gigabyte
    Hmmm I wonder what process is requesting it. Upon restart with no applications open it still shows 1.25
     
  17. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Some 3rd party service/app.



    Today I will start to implement script. You can tell me about wanted features. I want to do such ones:
    - listing devices with mark whether MSI-mode off or on
    - creation of reg-file for backup purposes
    - turning off MSI-mode for all devices
    - turning on MSI-mode for all devices (main feature)

    If should not be that complex/hard to implement, but I always start new project slowly. If you want script with main feature only, tell me.
     
    Last edited: Feb 21, 2014
  18. pjokerxp

    pjokerxp Banned

    Messages:
    652
    Likes Received:
    0
    GPU:
    Palit GeForce GTX 680 2GB
    wow greatly appreciated... thank you a ton mr. mbk sir

    will it work under windows 8.1?
     
  19. mbk1969

    mbk1969 Ancient Guru

    Messages:
    15,541
    Likes Received:
    13,561
    GPU:
    GF RTX 4070
    Development is fun.


    Script or MSI-mode?
    Just a joke (almost). Of course it should work. PowerShell is part of Windows since Vista. MSI-mode too (afaik).

    But! It is still unwise to switch all PCI devices to MSI-mode in bulk. Because if any of devices will give BSOD you will not know which one.

    Edit: Oops... I didn`t notice I posted this in wrong thread. Will continue in the right one.
     
    Last edited: Feb 21, 2014
  20. CPC_RedDawn

    CPC_RedDawn Ancient Guru

    Messages:
    10,413
    Likes Received:
    3,078
    GPU:
    PNY RTX4090
    Thanks for this..

    Just a couple of questions

    1) once I install the version I want, start the service, and check its working do I need to do this everytime I start windows or is it permanent until uninstall?

    2) What am I doing wrong here, I tested C++ version, installed it, started the service, then checked it was working and "current timer" still reads 10.000ms not 0.5000ms? Tested with BOTH versions and yes I uninstalled them each before installing the other one...?

    EDIT:

    Nevermind with the 2nd question I fixed it :) Tested with first C sharp version and it did nothing, uninstalled it and tested with the second version, still did nothing. Uninstalled that one and installed C++ version and bang timer resolution now reads 0.5ms :) thanks.

    Just need to know if this is permanent or do we need to do this everytime we start our system?
     
    Last edited: Feb 24, 2014

Share This Page