Results 1 to 5 of 5

Thread: High precision/resolution time, multicore issues

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008

    Default High precision/resolution time, multicore issues

    Is there any functionality in ClanLib to retrieve a high-precision/resolution time value like it is available with the Windows API ::QueryPerformanceCounter()?

    I searched the docs, forum and the code but couldn't find anything besides CL_System::get_time(). This functions implementation uses ::QueryPerformanceCounter() which makes good precision but limits the resolution by returning ms units only.

    Furthermore CL_System::get_time() seems to have a multicore-issue that occassionally results in discontinuous movement of objects if you base the timing in your games frame loop on it. "Occassionally" means e.g. once every ~30s, some times more often and very noticable.
    I could work around this by calling ::SetProcessAffinityMask( ::GetCurrentProcess(), 1 ) at the start of my game, but would loose platform-independence.
    (See also:;EN-US;Q274323 )

    Last, I suggest increasing the precision of CL_System::sleep() which has a default precision of only ~10ms under Windows by calling Windows-API ::timeBeginPeriod( 1 ) at process start and ::timeEndPeriod( 1 ) at process end. Or at least provide an option to do so.
    Last edited by z42; 01-14-2008 at 07:50 PM. Reason: add another link for QueryPerformanceCounter() issues

Similar Threads

  1. high scores
    By rzaccar in forum Dungeon Scroll for PC and iPhone
    Replies: 5
    Last Post: 04-20-2013, 01:02 PM
  2. resolution, mouse cursor, etc
    By Uhfgood in forum Novashell Game Creation System
    Replies: 1
    Last Post: 09-06-2007, 12:40 AM
  3. Resolution Independent Drawing
    By glorified_ameba in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 03-28-2007, 05:33 PM
  4. Issues
    By Dorian1 in forum RTsoft Tavern
    Replies: 1
    Last Post: 09-09-2004, 09:07 PM
  5. high score for dungeon scroll
    By jimbobbucky in forum RTsoft Tavern
    Replies: 22
    Last Post: 04-28-2004, 08:27 PM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts