view src/alice/test/codesegment/api/PeekCodeSegment.java @ 238:e4a5da56b394

minor change
author sugi
date Mon, 08 Apr 2013 15:29:24 +0900
parents bc451bb72d5a
children
line wrap: on
line source

package alice.test.codesegment.api;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;

public class PeekCodeSegment extends CodeSegment{
	private Receiver info0 = ids.create(CommandType.PEEK);
	public PeekCodeSegment(String key) {
		info0.setKey(key);
	}

	@Override
	public void run() {
		if (StartCodeSegment.count>10000){
			System.out.println(System.currentTimeMillis()-StartCodeSegment.t +" ms");
			StartCodeSegment.count = 0;
			
			if (++StartCodeSegment.cnt>100){
				System.exit(0);
			}
		} else {
			if(StartCodeSegment.count==1)StartCodeSegment.t = System.currentTimeMillis();
			StartCodeSegment.count++;
		}
		new PeekCodeSegment(info0.key);
	}

}