Category: PHP, javascript

All top programming languages have proved their positions and “decided” on the niches of their use.However, it is important for every programmer to have an understanding of the quantitative characteristics for each of the languages they use.You can measure quite a lot of parameters for different purposes.For some tasks, it will be more important to have a quick calculation of mathematical operations. And for others, faster work with the network and files is more useful.

As a calculation task, let’s take the function of checking: whether the number is Prime or Not — “is prime”. There is you can see the series of Prime Numbers: Let’s take the basic algorithm for checking: the number is not even and is not divisible by a smaller number up to the root of the desired number (that is, in the loop, go from 3 to the root of the number).We will need to calculate a number of Prime numbers-up to the maximum.

In the algorithm and in the code below, you can see that I did not use parallelization, for a more “honest” estimate of execution time.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners