Skip to content

Instantly share code, notes, and snippets.

View hristo-vrigazov's full-sized avatar

Hristo Vrigazov hristo-vrigazov

View GitHub Profile
@hristo-vrigazov
hristo-vrigazov / example_compare.py
Created December 30, 2020 10:37
Python example compare
import numpy as np
from time import time
num_experiments = 20
totals = np.zeros(num_experiments)
for i in range(num_experiments):
start = time()
arr = np.random.randint(0, 1000, size=100000000, dtype=np.int32)
print('Generation took ', time() - start)
start = time()
@hristo-vrigazov
hristo-vrigazov / Main.java
Last active December 30, 2020 10:45
Example compare Java
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Main {
public static void main(String[] args) {
List<Long> times = new ArrayList<>();
int numExperiments = 20;
long[] totals = new long[numExperiments];
Random random = new Random();