Re: TextOut() to a DialogBox ???
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in
message news:t9llq51cd2lh0nibo6ku1lt8v43usnen7q@4ax.com...
See below...
On Wed, 24 Mar 2010 19:31:54 -0500, "Peter Olcott"
<NoSpam@OCR4Screen.com> wrote:
"Hector Santos" <sant9442@nospam.gmail.com> wrote in
message
news:uxSdCP6yKHA.5132@TK2MSFTNGP05.phx.gbl...
Peter Olcott wrote:
void Process() {
clock_t finish;
clock_t start = clock();
double duration;
uint32 num = 0;
for (uint32 N = 0; N < Max; N++)
num = Data[num];
finish = clock();
duration = (double)(finish - start) /
CLOCKS_PER_SEC;
printf("%4.2f Seconds\n", duration);
}
What explains why I am only using 120 MB of the 12 GB of
RAM
bandwidth?
Is there a way to stress test memory even more?
****
Maybe, just maybe....write a working program! And PUT
SOMETHING IN MEMORY! I don't see
anything in memory! You are attempting to access an empty
array with an uninitialized
variable.
Maybe, by "crash", you meant a "runtime error" in the
6000-series, "attempt to access
uninitialized variable". But then, if that was what had
actually happened, you would have
said that instead of using the noise word (content-free
noise word) "crash" when
explaining that your program didn't work!
joe
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
I will post it all yet again.
What explains why I am only using 120 MB of the 12 GB of RAM
bandwidth? (MemTest86 Reports RAM Speed of 12 GB /Sec)
Is there a way to stress test memory even more?
This is the key finite state machinne loop:
for (uint32 N = 0; N < Max; N++)
num = Data[num];
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <time.h>
//#define uint32 unsigned int
typedef unsigned int uint32;
const uint32 size = 100000000;
std::vector<uint32> Data;
uint32 Max = 0x3fffffff;
double Process() {
long long Sum = 0;
clock_t finish;
clock_t start = clock();
double duration;
uint32 num = 0;
for (uint32 N = 0; N < Max; N++)
num = Data[num];
finish = clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
return duration;
}
void Initialize() {
Data.resize(size);
for (uint32 N = 0; N < size; N++) {
uint32 Random = rand() * rand();
Random %= size;
Data[N] = Random;
}
char N;
printf("Hit any key to Continue:");
scanf("%c", &N);
}
int main() {
double duration;
double MBperSec;
printf("Size in bytes--->%d\n", size * 4);
Initialize();
duration = Process();
MBperSec = (double)(Max * 4) / (duration * 1024 * 1024);
printf("%4.2f Seconds %4.2f Megabytes Per Second\n",
duration, MBperSec);
return 0;
}