lundi 22 février 2016

Java Random Number Count Error?

I have a timing method to compare different versions of a RandomCount class.

  public long timer() throws IndexingError{
    long time = System.currentTimeMillis();
    randomise();
    return (((long) System.currentTimeMillis() - time)/1000);
}

However when I run it in it's test class it doesn't appear with anything despite the fact that I have a System.out.println in there to print the times.

 public void test() throws IndexingError {
    double timer1;
    double timer2;

    CleverRandomCount cleverrandomtest = new CleverRandomCount(100000);
    timer1 = cleverrandomtest.timer();
    System.out.println(timer1);

    SimpleRandomCount simplerandomtest = new SimpleRandomCount(100000);
    timer2 = simplerandomtest.timer();
    System.out.println(timer2);
}

Am I missing some extra lines that will help print the times for both random counts?




Aucun commentaire:

Enregistrer un commentaire