How to get a very accurate time when CPU does heavy tasks?

Discussion in 'C Programming' started by lialie@gmail.com, Mar 6, 2007.

  1. Guest

    Hi, all
    Suppose have two threads, one thread(A) does heavy calculations, the
    other one(B) must get a accurate time.Thread B can't cost too much
    cpu's resource, but it must trigger an event at very time.I do it in
    Windows XP, How to?

    Thanks,
     
    , Mar 6, 2007
    #1
    1. Advertising

  2. santosh Guest

    wrote:
    > Hi, all
    > Suppose have two threads, one thread(A) does heavy calculations, the
    > other one(B) must get a accurate time.Thread B can't cost too much
    > cpu's resource, but it must trigger an event at very time.I do it in
    > Windows XP, How to?


    This group only deals with ISO C. Since the code to do what you want
    is system specific, please ask in a Windows group like comp.os.ms-
    windows.programmer.win32.
     
    santosh, Mar 6, 2007
    #2
    1. Advertising

  3. Flash Gordon Guest

    wrote, On 06/03/07 05:52:
    > Hi, all
    > Suppose have two threads, one thread(A) does heavy calculations, the
    > other one(B) must get a accurate time.Thread B can't cost too much
    > cpu's resource, but it must trigger an event at very time.I do it in
    > Windows XP, How to?


    Start by asking in a group where windows specifics are topical since
    this cannot be done in standard C. There are lots of groups in
    microsoft.* one of which will probably do.
    --
    Flash Gordon
     
    Flash Gordon, Mar 6, 2007
    #3
  4. Flash Gordon said:

    > wrote, On 06/03/07 05:52:
    >> Hi, all
    >> Suppose have two threads, one thread(A) does heavy calculations, the
    >> other one(B) must get a accurate time.Thread B can't cost too much
    >> cpu's resource, but it must trigger an event at very time.I do it in
    >> Windows XP, How to?

    >
    > Start by asking in a group where windows specifics are topical since
    > this cannot be done in standard C. There are lots of groups in
    > microsoft.* one of which will probably do.


    He'd probably be better off in comp.os.ms-windows.programmer.win32 -
    many Windows experts avoid the Microsoft groups like the plague.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at the above domain, - www.
     
    Richard Heathfield, Mar 6, 2007
    #4
  5. CBFalconer Guest

    wrote:
    >
    > Suppose have two threads, one thread(A) does heavy calculations,
    > the other one(B) must get a accurate time.Thread B can't cost too
    > much cpu's resource, but it must trigger an event at very time. I
    > do it in Windows XP, How to?


    It is rude to barge in on a conversation with a new topic. It is
    especially rude to do so when listening for a short time would have
    make it obvious that it was off-topic. It is even worse when there
    are many public notices available as to what is and is not topical
    and with answers to frequently asked questions (FAQ).

    --
    <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
    <http://www.securityfocus.com/columnists/423>

    "A man who is right every time is not likely to do very much."
    -- Francis Crick, co-discover of DNA
    "There is nothing more amazing than stupidity in action."
    -- Thomas Matthews
     
    CBFalconer, Mar 6, 2007
    #5
  6. Old Wolf Guest

    On Mar 6, 11:29 pm, CBFalconer <> wrote:
    > wrote:
    >
    > > Suppose have two threads, one thread(A) does heavy calculations,
    > > the other one(B) must get a accurate time.Thread B can't cost too
    > > much cpu's resource, but it must trigger an event at very time. I
    > > do it in Windows XP, How to?

    >
    > It is rude to barge in on a conversation with a new topic.


    Which conversation is the OP barging in on?
     
    Old Wolf, Mar 6, 2007
    #6
  7. CBFalconer Guest

    Old Wolf wrote:
    > On Mar 6, 11:29 pm, CBFalconer <> wrote:
    >> wrote:
    >>
    >>> Suppose have two threads, one thread(A) does heavy calculations,
    >>> the other one(B) must get a accurate time.Thread B can't cost too
    >>> much cpu's resource, but it must trigger an event at very time. I
    >>> do it in Windows XP, How to?

    >>
    >> It is rude to barge in on a conversation with a new topic.

    >
    > Which conversation is the OP barging in on?


    The c.l.c conversation(s).

    --
    <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
    <http://www.securityfocus.com/columnists/423>

    "A man who is right every time is not likely to do very much."
    -- Francis Crick, co-discover of DNA
    "There is nothing more amazing than stupidity in action."
    -- Thomas Matthews
     
    CBFalconer, Mar 7, 2007
    #7
  8. SM Ryan Guest

    # > > Suppose have two threads, one thread(A) does heavy calculations,
    # > > the other one(B) must get a accurate time.Thread B can't cost too
    # > > much cpu's resource, but it must trigger an event at very time. I
    # > > do it in Windows XP, How to?

    General operating systems cannot do this. They are good at resuming a
    task (eventually) after a specified time, but not at running a task at a
    specified time. Various real time operating systems, or real time
    components added to general operating system. Look for real-time
    programming in your operating system documentation, or a real-time
    operating system.

    --
    SM Ryan http://www.rawbw.com/~wyrmwif/
    Wow. A sailboat.
     
    SM Ryan, Mar 7, 2007
    #8
  9. KingMax Guest

    Thank you for your suggestion.
    I know about real time programming very little, so lost my way.
    And sorry for posting a digression here.
     
    KingMax, Mar 9, 2007
    #9
  10. Richard Guest

    "Old Wolf" <> writes:

    > On Mar 6, 11:29 pm, CBFalconer <> wrote:
    >> wrote:
    >>
    >> > Suppose have two threads, one thread(A) does heavy calculations,
    >> > the other one(B) must get a accurate time.Thread B can't cost too
    >> > much cpu's resource, but it must trigger an event at very time. I
    >> > do it in Windows XP, How to?

    >>
    >> It is rude to barge in on a conversation with a new topic.

    >
    > Which conversation is the OP barging in on?
    >


    Ignore Falconer. He's on a one man crusade to prove he's the rudest
    entity on usenet.
     
    Richard, Mar 10, 2007
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Minti
    Replies:
    4
    Views:
    879
    John C. Bollinger
    Feb 12, 2004
  2. Amit
    Replies:
    1
    Views:
    424
    Andrew Thompson
    Sep 7, 2004
  3. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    499
    Raymond Hettinger
    Jul 27, 2003
  4. shanx__=|;-

    very very very long integer

    shanx__=|;-, Oct 16, 2004, in forum: C Programming
    Replies:
    19
    Views:
    1,682
    Merrill & Michele
    Oct 19, 2004
  5. Can I print more accurate time?

    , Feb 24, 2006, in forum: C Programming
    Replies:
    1
    Views:
    276
    Ian Collins
    Feb 24, 2006
Loading...

Share This Page