There are several possible solutions for monitoring Java performance.
System.currentTimeMillis()
java -verbosegc <your_program>