By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,915 Members | 1,345 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,915 IT Pros & Developers. It's quick & easy.

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

P: n/a
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 '07 #1
Share this Question
Share on Google+
9 Replies


P: n/a
li****@gmail.com 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.

Mar 6 '07 #2

P: n/a
li****@gmail.com 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
Mar 6 '07 #3

P: n/a
Flash Gordon said:
li****@gmail.com 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.
Mar 6 '07 #4

P: n/a
li****@gmail.com 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

Mar 6 '07 #5

P: n/a
On Mar 6, 11:29 pm, CBFalconer <cbfalco...@yahoo.comwrote:
lia...@gmail.com 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?

Mar 6 '07 #6

P: n/a
Old Wolf wrote:
On Mar 6, 11:29 pm, CBFalconer <cbfalco...@yahoo.comwrote:
>lia...@gmail.com 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
Mar 7 '07 #7

P: n/a
# 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.
Mar 7 '07 #8

P: n/a

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

Mar 9 '07 #9

P: n/a
"Old Wolf" <ol*****@inspire.net.nzwrites:
On Mar 6, 11:29 pm, CBFalconer <cbfalco...@yahoo.comwrote:
>lia...@gmail.com 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.
Mar 10 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.