Profiling compiling mode

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Profiling compiling mode

Post by luis »

idle wrote: Wed Mar 15, 2023 3:58 pm Q How long does it take for a 64 bit counter to roll over runing at 2 and 4 ghz?
I've calculated it this way: 2 ^ 64 * (1 second / CPU freq in Hz) = seconds to rollover
The number of available bits multiplied by the time required to do one cycle in seconds.

So, for a 2 GHz CPU

Code: Select all

Debug Pow(2,64) * (1.0 / (2 * 1000 * 1000 * 1000)) / 60 / 60 / 24 / 365
gives 292 years ... If I'm not mistaken.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
idle
Always Here
Always Here
Posts: 5840
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Profiling compiling mode

Post by idle »

luis wrote: Tue Sep 12, 2023 11:06 pm
idle wrote: Wed Mar 15, 2023 3:58 pm Q How long does it take for a 64 bit counter to roll over runing at 2 and 4 ghz?
I've calculated it this way: 2 ^ 64 * (1 second / CPU freq in Hz) = seconds to rollover
The number of available bits multiplied by the time required to do one cycle in seconds.

So, for a 2 GHz CPU

Code: Select all

Debug Pow(2,64) * (1.0 / (2 * 1000 * 1000 * 1000)) / 60 / 60 / 24 / 365
gives 292 years ... If I'm not mistaken.
only that long. :lol:
Yes that looks right, thank.
tored
User
User
Posts: 86
Joined: Wed Feb 16, 2022 12:47 pm
Location: Sweden

Re: Profiling compiling mode

Post by tored »

The new C backend uses GCC, right? Possible to compile with gprof?
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Profiling compiling mode

Post by StarBootics »

tored wrote: Wed Sep 13, 2023 3:12 am The new C backend uses GCC, right? Possible to compile with gprof?
Only Fred can answer that. That being said, Fred will probably want a solution that work for both backends (ASM and C).

Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
User avatar
idle
Always Here
Always Here
Posts: 5840
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Profiling compiling mode

Post by idle »

tored wrote: Wed Sep 13, 2023 3:12 am The new C backend uses GCC, right? Possible to compile with gprof?
maybe on linux, doesn't work with the supplied gcc compiler on windows
Post Reply