I've read that ElapsedMilliseconds() is a wrapper for GetTickCount_(). But the following article shows that GetTickCount_() is less accurate than timeGetTime_(), so my request is that ElaspedMilliseconds() becomes a wrapper for timeGetTime_() instead.
http://blogs.msdn.com/b/larryosterman/a ... ttime.aspx
ElapsedMilliseconds()
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
ElapsedMilliseconds()
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: ElapsedMilliseconds()
It is a matter of libraries. PureBasic wants to generate small executables and if you wrap timeGetTime you would link to a completely different library.
bye,
Daniel
Daniel
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: ElapsedMilliseconds()
Oh.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: ElapsedMilliseconds()
I dont understand that. There is no difference in size if you import timeGetTime or getTickCount. Both are simple API imports.DarkDragon wrote:It is a matter of libraries. PureBasic wants to generate small executables and if you wrap timeGetTime you would link to a completely different library.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: ElapsedMilliseconds()
It's a question of libraries to be sure, but I don't believe Fred's choice here was based on exe size. If I had to guess I'd say it's more a compatibility issue, as there have been numerous performance issues with winmm.lib (which timeGetTime uses) when linked in with programs running on Windows 2000. Here's a sample: http://support.microsoft.com/kb/266327
GetTickCount, from good old trusty kernel32, is the much safer choice and one I personally agree with. It's less overhead and the chances for trouble down the road are much less. The only capability you miss is that with timeGetTime you can adjust your accuracy with the use of timeBeginPeriod etc., otherwise they don't differ much. I guess the team figured that programmers who want to tap into the multimedia library can do that if they want to as it's already imported, and left the native command simple and safe.
Just my 2 cents, and inflation is eating away at that.
GetTickCount, from good old trusty kernel32, is the much safer choice and one I personally agree with. It's less overhead and the chances for trouble down the road are much less. The only capability you miss is that with timeGetTime you can adjust your accuracy with the use of timeBeginPeriod etc., otherwise they don't differ much. I guess the team figured that programmers who want to tap into the multimedia library can do that if they want to as it's already imported, and left the native command simple and safe.
Just my 2 cents, and inflation is eating away at that.
BERESHEIT
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: ElapsedMilliseconds()
timeGetTime is afaik corresponding to winmm and GetTickCount is kernel32. Sure, the difference is small, but maybe that's the reason why it hasn't been done already. A few years ago I thought Fred would program a Demo/Intro-Scene language where every byte counts.Thorium wrote:I dont understand that. There is no difference in size if you import timeGetTime or getTickCount. Both are simple API imports.DarkDragon wrote:It is a matter of libraries. PureBasic wants to generate small executables and if you wrap timeGetTime you would link to a completely different library.
bye,
Daniel
Daniel