473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
9 2186
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
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
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
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
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
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
# 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

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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
43
by: Mike MacSween | last post by:
Or something to do with Nulls in PK. Which is obviously wrong. OK, after a diversion of having to earn money its back to the free one. The orchestral management system. At the E-R level: An...
10
by: Jason Curl | last post by:
Greetings, I have an array of 32 values. This makes it extremely fast to access elements in this array based on an index provided by a separate enum. This array is defined of type "unsigned long...
1
by: Oskar Bennet | last post by:
Hi everybody, I am supposed to draw a simple UML diagram for a very small project that consists of less than a dozen classes. I have never been working with UML before, I have read some tutorials...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.