ElapsedMilliseconds() PB 5.60 B8
ElapsedMilliseconds() PB 5.60 B8
Debug ElapsedMilliseconds()
Return 0
Win 10 64 Bit PB 32 Bit
Return 0
Win 10 64 Bit PB 32 Bit
- Zebuddi123
- Enthusiast
- Posts: 796
- Joined: Wed Feb 01, 2012 3:30 pm
- Location: Nottinghamshire UK
- Contact:
Re: ElapsedMilliseconds() PB 5.60 B8
Confirmed win 10 x64 tested all beta`s 8,7,6,5,4 all the same
Zebuddi.
Zebuddi.
malleo, caput, bang. Ego, comprehendunt in tempore
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: ElapsedMilliseconds() PB 5.60 B8
That might actually not be a bug. It's possible that the first call to ElapsedMilliseconds() starts the count from 0:
Or maybe it is. Fred will say.
Code: Select all
Debug ElapsedMilliseconds() ; 0
Delay(800)
Debug ElapsedMilliseconds() ; 800
BERESHEIT
Re: ElapsedMilliseconds() PB 5.60 B8
netmaestro I believe is correct. With PB 5.60 Beta 8, it starts with 0, with PB 5.44LTS it doesn't. With LTS, it seems to be unreliable at times. With PB 5.60 Beta 8, it seems spot on every time.
With PureBasic 5.60 Beta 8
0
1000
----
With PureBasic 5.44LTS
230004685
1000
----
however it often shows instead 1001 with 5.44LTS. Also, 230004685 isn't constant set of numbers.
Code: Select all
StartTime = ElapsedMilliseconds() ; Get the actual value
Debug StartTime
Delay(1000) ; Wait 1000 milliseconds
ElapsedTime = ElapsedMilliseconds()-StartTime
Debug ElapsedTime
Debug "----"
0
1000
----
With PureBasic 5.44LTS
230004685
1000
----
however it often shows instead 1001 with 5.44LTS. Also, 230004685 isn't constant set of numbers.
Last edited by Thunder93 on Wed Mar 01, 2017 4:51 am, edited 1 time in total.
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Re: ElapsedMilliseconds() PB 5.60 B8
Not a bug, because the manual specifically says:
So calling it once is naturally going to return 0.PureBasic manual wrote:this function should be used to calculate time differences between multiple ElapsedMilliseconds() calls
Re: ElapsedMilliseconds() PB 5.60 B8
I am sure it is by design, because the new underlying API would require a quad and that would lead to errors in many old codes.
A difference is calculated of two numbers and has nothing to do with 0.Dude wrote:So calling it once is naturally going to return 0.
sorry for my bad english
Re: ElapsedMilliseconds() PB 5.60 B8
yea its not a bug. its a design change.
it looks like now the initial value gets set on the first call of ElapsedMilliseconds(). why not at program start though? would be more logical imho.
c ya,
nco2k
it looks like now the initial value gets set on the first call of ElapsedMilliseconds(). why not at program start though? would be more logical imho.
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Re: ElapsedMilliseconds() PB 5.60 B8
It was already like this on OSX and Linux, so I just did the same on Windows. ElapsedMilliseconds() is not from program start, it's between 2 call of it.
Re: ElapsedMilliseconds() PB 5.60 B8
What is with threads?
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: ElapsedMilliseconds() PB 5.60 B8
It's a global timer, so thread doesn't affect it.
Re: ElapsedMilliseconds() PB 5.60 B8
Fred, if our world was fair, and technical expertise was given similar value to musical and vocal expertise,Fred wrote:It was already like this on OSX and Linux, so I just did the same on Windows. ElapsedMilliseconds() is not from program start, it's between 2 call of it.
then you would likely be a very wealthy man, close to the Paul McCartney level.
I hope things change.
Thanks, and peace.
Keep it BASIC.