Új hozzászólás Aktív témák
-
sztanozs
veterán
from timeit import default_timer as timer
def testTime(execution):
start = timer()
execution()
end = timer()
return(execution.__name__, end - start)
def while1():
count = 9000
while count:
count = count - 1
print(9000-count)
pass
def while2():
count = 0
while (count < 90000):
count += 1
print(count)
pass
def for1():
for i in range(1,90000):
print(i)
pass
de = {}
a,b = testTime(while1)
de[a] = b
a,b = testTime(while2)
de[a] = b
a,b = testTime(for1)
de[a] = b
print(de)Eredmény:
{
'while1': 0.017804100422010548,
'while2': 0.2117797429410634,
'for1': 0.2141544650973869
}
Új hozzászólás Aktív témák
- HP ELITEBOOK 855 G8 Ryzen 3 5400U 16gb ram 256ssd FHD IPS Gari
- HP ELITEBOOK 850 G8 i5 1145G7/16GB ram 256ssd/FHD
- Újszerű Lenovo Legion 5 - 15,6"FHD IPS - Ryzen 5 5600H - 16GB - 512GB SSD - RTX 3050 - Win11 -MAGYAR
- ÚJ Lenovo LOQ 15IRX9 - QHD 165Hz - i7-13650HX - 16GB - 1TB - RTX 4060 - Win11 - 3 év garancia
- ÚJ CORE I7 12700 Z690 RIPTIDE GAMER MAX PC 32Gb RAM 1.0TB SSD GEFORCE RTX 3070TI 8GB DDR7 2ÉV GAR!
- ÁRGARANCIA!Épített KomPhone i5 10600KF 16/32/64GB RAM RTX 3050 6GB GAMER PC termékbeszámítással
- Telefon felvásárlás!! iPhone X/iPhone Xs/iPhone XR/iPhone Xs Max
- Samsung Galaxy S6 Lite (2022) , 4/64 GB ,Wi-fi
- 138 - Lenovo Legion Pro 7 (16IRX9H) - Intel Core i9-14900HX, RTX 4080
- Samsung SyncMaster 205BW Monitor
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Promenade Publishing House Kft.
Város: Budapest