1 package org.tanukisoftware.wrapper.test; 2 3 45 46 import java.io.FileWriter ; 47 import java.io.IOException ; 48 49 54 public class OutputLoader { 55 58 public static void main(String [] args) { 59 System.out.println("Start outputting lots of data."); 60 61 long start = System.currentTimeMillis(); 62 long now; 63 int count = 0; 64 while ((now = System.currentTimeMillis()) < start + 20000) { 65 System.out.println("Testing line Out #" + (++count)); 66 System.err.println("Testing line Err #" + (++count)); 67 } 68 69 System.out.println("Printed " + count + " lines of output in 20 seconds"); 70 71 try { 74 FileWriter fw = new FileWriter ("OutputLoader.log", true); 75 fw.write("Printed " + count + " lines of output in 20 seconds\n"); 76 fw.close(); 77 } catch (IOException e) { 78 e.printStackTrace(); 79 } 80 } 81 } 82 83 | Popular Tags |