X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Ftests%2FSpeedTest.java;h=9597a5b6ef929e71e7d3bd03e47f99939a3ca5cf;hp=46b0f76a9c5a6d108df8336d709b260587dc4962;hb=b11e7c6c29f2b5f7b0828bf93eb741c4a30ec411;hpb=e66ecb6291d5d0f99bf48c9d56ceabb92c958bc2 diff --git a/src/tests/SpeedTest.java b/src/tests/SpeedTest.java index 46b0f76..9597a5b 100644 --- a/src/tests/SpeedTest.java +++ b/src/tests/SpeedTest.java @@ -1,7 +1,13 @@ +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package tests; -import org.xwt.mips.Runtime; -import org.xwt.mips.Interpreter; +import org.ibex.nestedvm.Runtime; + +//import java.io.*; +//import java.util.*; class SpeedTest { private static long start,end; @@ -10,6 +16,24 @@ class SpeedTest { private static void end() { end = now(); } private static float diff() { return ((float)(end-start))/1000; } + /*private static InputStream is = new InputStream() { + int left = 100*1024*1024; + int c = 0; + public int read() { if(left==0) return -1; left--; return (c++)&0xff; } + public int read(byte[] buf, int pos,int len) { + len = Math.min(left,len); + Arrays.fill(buf,pos,len,(byte)c++); + left -= len; + return len; + } + public void close() { left = 100*1024*1024; } + }; + + private static OutputStream os = new OutputStream() { + public void write(int c) { } + public void write(byte[] buf, int pos, int len) { } + };*/ + public static void main(String[] args) throws Exception { float d; @@ -46,11 +70,16 @@ class SpeedTest { for(int i=0;i