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

L

lialie

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,
 
S

santosh

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.
 
F

Flash Gordon

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.
 
R

Richard Heathfield

Flash Gordon said:
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.
 
C

CBFalconer

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
 
S

SM Ryan

# > > 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.
 
K

KingMax

Thank you for your suggestion.
I know about real time programming very little, so lost my way.
And sorry for posting a digression here.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top