Skip to content

Instantly share code, notes, and snippets.

View albow-net's full-sized avatar

あるぼう albow-net

View GitHub Profile
@albow-net
albow-net / array_test.java
Last active August 18, 2017 03:53
配列の読み書き速度測定用ソースコード
import java.util.ArrayList;
import java.util.Collections;
public class test{
private static int test_arraylist( int N, int num ) {
// 長さNの配列を用意し0で初期化
ArrayList<Integer> array = new ArrayList<Integer>( Collections.nCopies(N, 0) );
// 各要素にnumを代入
for ( int i = 0; i < N; i++ ) {
@albow-net
albow-net / array_test.cpp
Created August 18, 2017 03:47
配列の読み書き速度測定用ソースコード
#include <iostream>
#include <vector>
#include <string>
int test_array( const int N, const int num ) {
// 長さNの配列を用意
int *array = new int[N];
int sum = 0;
// 0で初期化