computed: {
newArray() {
let res = []
for (i = 0; i < this.table.DAYS.length; i++) {
res.push(Object.assign(this.table.DAYS[i], this.table.WORK[i]))
}
return res
}
}
return this.table.DAYS.concat(this.table.WORK)
a = [1 for x in range(100000000)]
a.append(5)
a.append(4)
a.append(3)
a.append(2)
a.append(2)
sorted: 0.9813046455383301
sort: 0.41123247146606445
перебор: 1.800027847290039
count: 0.10200023651123047
filter: 5.901871204376221
sum: 0.6795947551727295
import time
a = [1 for x in range(100000000)]
now_time = time.time()
sorted(a)
print(time.time() - now_time)
now_time = time.time()
for _ in a:
pass
print(time.time() - now_time)
now_time = time.time()
if a.count(1) == len(a):
pass
print(time.time() - now_time)
0.9765689373016357
1.7929527759552002
0.10001277923583984
import time
a = [1 for x in range(10000000)]
now_time = time.time()
sorted(a)
print(time.time() - now_time)
now_time = time.time()
for _ in a:
pass
print(time.time() - now_time)
0.0980081558227539
0.19829130172729492