This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
OlderNewer