view src/alice/test/codesegment/api/PutCodeSegment.java @ 290:4074077d118d

Refactor iterating process with for-each sentence.
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Fri, 18 Oct 2013 03:26:38 +0900
parents 9db7fcf98ee9
children
line wrap: on
line source

package alice.test.codesegment.api;

import alice.codesegment.CodeSegment;

public class PutCodeSegment extends CodeSegment{
	
	private static int count = 0;
	
	@Override
	public synchronized void run() {
		
		int[] array = new int[1000];
		for (int i = 0;i< 999; i++)
			array[i] = i;
		
		if (count % 10 == 0)
			System.out.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024 + "MB");
		if (count >= 10000000) {
			System.exit(0);
		}
		ods.put("local", "num", array);
		count++;
		try {
			wait(100);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		new PutCodeSegment().execute();
	}
	

}