public void serializeTimingData ( Path outputPath ) { //merge subThreads instances into the main instance merge ( ) ; try ( FileWriter fw = new FileWriter ( outputPath . toFile ( ) ) ) { fw . write ( "Number Of Executions, Total Milliseconds, Milliseconds per execution, Type\n" ) ; for ( Map . Entry < String , TimingData > timing : executionInfo . entrySet ( ) ) { TimingData data = timing . getValue ( ) ; long totalMillis = ( data . totalNanos / 1000000 ) ; double millisPerExecution = ( double ) totalMillis / ( double ) data . numberOfExecutions ; fw . write ( String . format ( "%6d, %6d, %8.2f, %s\n" , data . numberOfExecutions , totalMillis , millisPerExecution , StringEscapeUtils . escapeCsv ( timing . getKey ( ) ) ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } }
Serializes the timing data to a ~ delimited file at outputPath .