Periodic function
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Periodic function

  1. #1
    Join Date
    Dec 2005
    Posts
    382

    Periodic function

    I'd like to execute a function at 100Hz. IOW, every 100Hz I'd like to call say a 'foo' method. At issue: I only have Visual Studio Express (2005 and 2008). My research thus far suggest that I'm not able to use the Windows API suite (SetTimer, CreateEvent etc. etc ). True/False?

    Is it possible then to achieve my objective via QueryPerformanceCounter or std::clock?

    Thanks in advance

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Periodic function

    True/False
    True. The standard windows timers can't even come close to what you want.

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,097

    Re: Periodic function

    Hz is not a unit of time. Your question doesn't make sense.

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,888

    Re: Periodic function

    The meaning is clear despite the incorrect units. Every 10 milliseconds = 100Hz. And yeah, you'll need a kernel-level interrupt mechanism to guarantee that sort of granularity.

  5. #5
    Join Date
    Feb 2002
    Posts
    3,788

  6. #6
    Join Date
    Dec 2005
    Posts
    382

    Re: Periodic function

    Quote Originally Posted by GCDEF View Post
    Hz is not a unit of time. Your question doesn't make sense.
    And thats the best you could do? Get a grip!!

  7. #7
    Join Date
    Dec 2005
    Posts
    382

    Re: Periodic function

    I might have a follow up question on this, nonetheless, thanks Alin, Skizmo and Lindley.

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,097

    Re: Periodic function

    Quote Originally Posted by mop65715 View Post
    And thats the best you could do? Get a grip!!
    Programming is an exact science. Using the correct terminology is important.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center