Python vs C/C++ speed test | Counting to 1 billion | #shorts #python #cpp

preview_player
Показать описание
#shorts #python #cpp
programming and coding python speed test
Рекомендации по теме
Комментарии
Автор

That's a bigger difference than I thought

code_hell
Автор

That's me during exam, my learning skills vs my paper solving skills 😂

vedantkandalkar
Автор

For the python die-hards, you can still call C code in python. It should be much faster and still python.😁

joshuakalule
Автор

4 seconds! thats slow af, did you try using "-O3" or "-O2" flags with gcc?

ItsCOMMANDer_
Автор

I wish python had C speed because python is easier ;(

Unlimit
Автор

Python is slow cuz python itself is coded in C, First python code gets converted into c and than it run 💀

masoomdarinda
Автор

This happend when you dont know how use a programming language, python its a lot more slow than c++ but no with that difference

Try this:

from time import perf_counter
from itertools import repeat

start = perf_counter()

n = sum(list(repeat(1, 1_000_000_000)))

end = perf_counter()

the_time = end - start

print(f"time: {the_time}")

print(n)

Time less than 12sec in my pc

javieralejandroramirezgarc
Автор

Its like Comparing apples with oranges.

sachindeshpande
visit shbcf.ru