S
Stu
Hi guys,
I've been having trouble getting the clock function to work portably,
please could I get some thoughts?
<Possibly OT comments>
It works fine on my laptop (under WinXP) and on my office computer
(under Linux), but I have to write some code for the system simulator
for the Cell BE processor (the thing inside the PS3), which is
apparently a PPC architecture, and I can't get the clock function to
return anything sensible - it returns 0 every time for no apparent
reason.
</Possibly OT comments>
The following is a cut-down version of my code which exhibits the
problem I'm having Any thoughts please? As far as I know the clock
function specification says something like "give the best result you
can", but surely "return 0;" wasn't what was in mind...?
#include <iostream>
#include <time.h>
int main()
{
for(; // (this is just example code)
{
std::cout << clock() << std::endl;
}
return 0;
}
Cheers,
Stu
I've been having trouble getting the clock function to work portably,
please could I get some thoughts?
<Possibly OT comments>
It works fine on my laptop (under WinXP) and on my office computer
(under Linux), but I have to write some code for the system simulator
for the Cell BE processor (the thing inside the PS3), which is
apparently a PPC architecture, and I can't get the clock function to
return anything sensible - it returns 0 every time for no apparent
reason.
</Possibly OT comments>
The following is a cut-down version of my code which exhibits the
problem I'm having Any thoughts please? As far as I know the clock
function specification says something like "give the best result you
can", but surely "return 0;" wasn't what was in mind...?
#include <iostream>
#include <time.h>
int main()
{
for(; // (this is just example code)
{
std::cout << clock() << std::endl;
}
return 0;
}
Cheers,
Stu