|
Also
QueryPerformanceFrequency() and QueryPerformanceCounter() if your machine supports it.
-- modified at 20:07 Wednesday 6th December, 2006
*Edit* QueryPerformanceFrequency() returns 3192270000 counts/sec on my machine. That sounds
pretty accurate
|
|
|
|
|
thanks to all, but i don't know where to find functions in yours answers ( as GetThreadTimes() API )! I'm using C++ but i know only C... How i have to set VC++ to use them??
p.s.: my OS is win XP
|
|
|
|
|
I guess you never said you were using Windows.
clock() is in the C runtime (time.h) so doesn't need Windows.
The others are part of Windows:
QueryPerformance functions and GetTickCount() are in windows.h/Kernel32.lib.
Mark
p.s. Thanks to whoever posted the QueryPerformance function link here a while back.
After rambling here about PCs not having the resolution I remembered the post and had to dig
through my favorites/bookmarks (which I now remember need a serious organizing).
|
|
|
|
|
Mark Salsbery wrote: I guess you never said you were using Windows.
Does VS2005 exist on any other platform?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Does VS2005 exist on any other platform?
Beats me, but I try not to assume, even though I do all the time.
|
|
|
|
|
lzzluca wrote: can merge sort be too fast to find order time by this code??).
Any sort is fast when only eight items are involved.
lzzluca wrote: I can't enlarge array (to have a bigger order time), so how i can do to find order time?
Why exactly do you need it? A sorting algorithm's time is only relevant on a particular machine. Move to a faster machine and the performance improves, but the number of comparisons/swaps does not change.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I'm a student! My teacher gave me a project to do for an examination: i have to compare merge sort and quicksort, using an 8 elements array... So, seems good to have order time of merge and quick sort on the same array! Or not?
|
|
|
|
|
lzzluca wrote: So, seems good to have order time of merge and quick sort on the same array! Or not?
No, time is not a very useful number, especially when comparing sorting algorithms. Consider the result if you ran merge sort on computer A, and quicksort on computer B. Unless the two computer were identical, your results would obviously be skewed.
Surely your teacher has gone over big-O notation in the context of "benchmarking" algorithms. Those numbers do not change no matter what computer platform you use.
In any case, if you still need to time them, you'll need to explain to your teacher that the smallest resolution Windows will give you is 10ms, so both algorithms, sorting 8 items, will appear to complete in 0 seconds.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This isn't of a whole lot of help but more food for thought.
Time is the Simplest Thing...[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
What determines the Name property of a proxy server that I am developing in Win32?
For instance, the proxy settings in Internet Explorer ask for a Name and port number. Well, the port number depends upon which port I bind my listening socket to, but what determines the "Name?"
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Richie308 wrote: but what determines the "Name?
I guess its the IP address or DNS name of the machine running the proxy
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
But what if you have more than one proxy running on a single machine?
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Then it must be listening on a different port not a different name.
led mike
|
|
|
|
|
Ahh yes! That must be it. Thanks!
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
Same name, differnt port. You cant bind two listening sockets to the same port
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
Hello ,
i would like to know how i could play a sound(wav)!Which function i must use?I tried to use the function PlaySound()!
Thanks
|
|
|
|
|
andreas_635 wrote: I tried to use the function PlaySound()
A very sound approach. :->
led mike
|
|
|
|
|
Ba-dump-PSHhh!
Good one
|
|
|
|
|
When you run this function what happens?
|
|
|
|
|
Hello ,
i would like to know how i could play a sound(wav)!Which function i must use?I tried to use the function <playsound()>!
Thanks
|
|
|
|
|
andreas_635 wrote: I tried to use the function !
I've not yet heard of that one. What all does it do? You might also give sndPlaySound() and PlaySound() a try.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Do you want to play only wav file if yes you can use of sndPlaySound
|
|
|
|
|
I am doing something like this...
void View::OnView() <br />
{ <br />
Dialog dlg();<br />
if(dlg.DoModal() == IDCANCEL)<br />
return;<br />
COIN Coin;<br />
if (dlg.m_ValCoinSwitch == " some text")<br />
Coin.lights[WFS_SIU_COINSWITCH] = ENABLE;<br />
<br />
else (dlg.m_ValCoin2Switch == "some text")<br />
Coin.lights[WFS_SIU_COINSWITCH] = DISABLE;<br />
}<br />
<code><br />
<br />
Now, what I am doing in here is "bringing the dialog with DoModal and coded like if Cancel is pressed, then it should return otherwise should run the OK". Now, I wonder what should be added before "COIN coin" so that when okay is pressed it should perform ENABLE or DISABLE whatever I chose from ComboBox.<br />
<br />
Will really appreciate help.<br />
<br />
Thanbs <br />
<br />
<div class="ForumSig">C++Prog</div>
|
|
|
|
|
celllllllll wrote: Now, I wonder what should be added before "COIN coin" so that when okay is pressed it should perform ENABLE or DISABLE...
If the if(...) condition evaluates to false, it is already doing that.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I got it worked..Thanks
C++Prog
|
|
|
|