Time library ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Time library ?

Post by Primoz128 »

Hello everyone !
I have tried Pure Basic yesterday, i have been searching for long for a language that suits me, i decided to go c++, but then i found Pure Basic, which i will use for whole my life probably along with a Game Maker tool for game development that is going insanely fast into world.

So i was trying to compare the speed of Pure Basic to C++, using a timer with a counter variable, and use counter to loop until 20 seconds have passed, then i would get the result, but i cannot find any kind of timer library... so how can i do this ? "Delay" function cannot be used for this, because it pauses the whole program <.>.

Thanks in advance =).
User avatar
STARGÅTE
Addict
Addict
Posts: 2235
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Time library ?

Post by STARGÅTE »

PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Time library ?

Post by Primoz128 »

STARGÅTE wrote:with a window: AddWindowTimer()
else: ElapsedMilliseconds()
Thank you very much !
Btw where can i get those web images for signature, what PB you sue, gfx card etc ?
User avatar
STARGÅTE
Addict
Addict
Posts: 2235
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Time library ?

Post by STARGÅTE »

This is my service^^

for example:
http://pb.unionbytes.de/PB$4.60%5ERC1_WIN$XP.png

keywords:
PB$, IE$, FF$, K$, WIN$, LNX$, NV$, ATI$, CPU$
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Time library ?

Post by MachineCode »

Primoz128 wrote:use counter to loop until 20 seconds have passed
Such a test is useless for comparing PureBasic to C. Just so you know.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Zach
Addict
Addict
Posts: 1676
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Time library ?

Post by Zach »

Synthetic benchmarks aren't going to help much.

You need to build a program that does time-critical computations, in both languages, while trying to be as fair with any optimizations as possible.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Time library ?

Post by Primoz128 »

I don't master any other language that Game Maker tool's built-in scripting language... ill try something out or google up a bit for a good way to compare C/C++ to Pure Basic, i just want to know, i am really curious in the speed.

Also is there no way in making external libraries for Pure Basic ? Also how the hell do you make an executable, all i found is save, save as and save all ... so ?
Zach
Addict
Addict
Posts: 1676
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Time library ?

Post by Zach »

...seriously?

Might try looking under the "Compiler" drop-down on the main Menu Bar.... Coming from a "Game Maker" application, you will have a lot to learn ahead of you. Starting with the Help files is a good start, as it explains the User Interface, as well as containing the Language Reference with lots of example code.

You should also read the PureBasic Survival Guide It is a very good work that will teach you a lot of the basics, as well as some more advanced stuff. It has also been updated for the up and coming 4.60 release of PureBasic.

It can use Inline ASM (Assembly Language) which will allow you to optimize your program further if you choose to learn ASM. But it is not childs play, be warned. You can compile DLL's to use in other programs you make, if you wish. You can also compile native PB "libraries" by using Tailbite. But it is not an official piece of software and I think there is some learning involved and getting it to work properly.


There are various forum members who can/will attest to PB being very competitive with, or outperforming C/C++ applications. But like all things it totally depends on the skill of the programmer, to a degree.

It's plenty fast though.
Last edited by Zach on Sun Sep 11, 2011 9:49 pm, edited 2 times in total.
infratec
Always Here
Always Here
Posts: 7620
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Time library ?

Post by infratec »

You can also build dll's with PB.
(simply type dll in the help index field)

And don't forgett to disable the debugger when you are running a speed test :wink:
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: Time library ?

Post by Primoz128 »

Zach wrote:...seriously?

Might try looking under the "Compiler" drop-down on the main Menu Bar.... Coming from a "Game Maker" application, you will have a lot to learn ahead of you. Starting with the Help files is a good start, as it explains the User Interface, as well as containing the Language Reference with lots of example code.

You should also read the PureBasic Survival Guide It is a very good work that will teach you a lot of the basics, as well as some more advanced stuff. It has also been updated for the up and coming 4.60 release of PureBasic.

It can use Inline ASM (Assembly Language) which will allow you to optimize your program further if you choose to learn ASM. But it is not childs play, be warned. You can compile DLL's to use in other programs you make, if you wish. You can also compile native PB "libraries" by using Tailbite. But it is not an official piece of software and I think there is some learning involved and getting it to work properly.


There are various forum members who can/will attest to PB being very competitive with, or outperforming C/C++ applications. But like all things it totally depends on the skill of the programmer, to a degree.

It's plenty fast though.
3/5 of that i already know and some of that for very long, assembly is just O.O really brain killer if you want to do a game in it using just assembly. Thanks anyways.

Oh and, man why does PB have only about 5000 people using it or at least around that number, while any other in top 10 language has more than 10 K really active ones... i understand it wasn't as good as it is now, i seen that in each version that is a tiny number increase of version name has huge improvements, but it should get more people to use it... or am i wrong ?
(I made a mess... shoot me <.> )

I don't like the 5000 number, and how people never heard of PB.
USCode
Addict
Addict
Posts: 924
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: Time library ?

Post by USCode »

Primoz128 wrote:... Oh and, man why does PB have only about 5000 people using it or at least around that number, while any other in top 10 language has more than 10 K really active ones... i understand it wasn't as good as it is now, i seen that in each version that is a tiny number increase of version name has huge improvements, but it should get more people to use it... or am i wrong ?
(I made a mess... shoot me <.> )

I don't like the 5000 number, and how people never heard of PB.
PB really has a LOT of things going for it: easy development, small/fast executables, many libraries, CROSS-PLATFORM, nice IDE, etc.

But I think the 2 things that turn off many potential users is:
- Lack of OOP support
- No actively-developed and truly integrated Visual Designer

I'm not advocating OOP and don't think we'll ever see it in PB, however an officially supported VD would be nice for many types of projects.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Time library ?

Post by MachineCode »

Primoz128 wrote:why does PB have only about 5000 people using it
Where the hell did you pull that number from? Do you receive a report from Fred about each paying customer?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Zach
Addict
Addict
Posts: 1676
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Time library ?

Post by Zach »

Primoz128 wrote: I don't like the 5000 number, and how people never heard of PB.

...Then don't use use the product?


Really, what does the number of users have to do with anything?
PB has been around for the better part of a decade now, and some programmers here use it daily in their businesses. PB isn't worried about how popular it is, its not trying to win a contest. If you're worried about investing in something that will disappear a year later, then we can all understand that but there really isn't any need to worry. Even if development stopped and the current staff could no longer continue, they have contingency plans for releasing it as Open Source so development can continue.

But more importantly; PureBasic is a Hobbyist language first and foremost. I don't think it has ever tried to pretend to be otherwise. Many of us here are just Hobbyists. I doubt the Forum even represents the rest of the users in any significant way. By the way, using Forum membership to try and extrapolate the number of paying customers is not very brilliant.
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Time library ?

Post by Kuron »

Primoz128 wrote:Oh and, man why does PB have only about 5000 people using it or at least around that number, while any other in top 10 language has more than 10 K really active ones... i understand it wasn't as good as it is now, i seen that in each version that is a tiny number increase of version name has huge improvements, but it should get more people to use it... or am i wrong ?
(I made a mess... shoot me <.> )

I don't like the 5000 number, and how people never heard of PB.
This is easy, it is for the same reason Game Maker has well less than 500 legitimate users. Just as many people developing games will frown at people using point and click game makers to make games, many people programming will frown at any BASIC language. When it comes to indie BASICs, PureBasic might be the biggest there is.

I do dispute your number of 5000 users of PureBasic.

4329 members registered at the English forums
1091 members registered at the French forums
2892 members registered at the German forums

8312 total members registered at all PB forums

Given that the forums are routinely purged of deadweight, I am fairly confident in the accuracy of those numbers. Also consider many who purchase and use PureBasic will never join any of the forums.

PureBasic is still alive and thriving while many of its competitors have bit the dust or abandoned products and started new ones because they can no longer attract users to their existing products.
Best wishes to the PB community. Thank you for the memories. ♥️
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: Time library ?

Post by MachineCode »

Primoz128, you may want to read the PureBasic Doomsday Quotes if you're worried about PureBasic's future:

http://tinyurl.com/doomsdayquotes

(The above links to: http://www.purebasic.fr/english/viewtop ... =7&t=45773).

Happy now? ;)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Post Reply