MCPcopy Create free account
hub / github.com/Berkeley-CS61B/skeleton-sp23 / main

Method main

lab03/src/timing/Experiments.java:79–95  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

77 }
78
79 public static void main(String[] args) {
80 // TODO: Modify the following line to change the experiment you're running
81 TimingData td = exampleFibonacciExperiment();
82 // Modify this line to make the chart title make sense
83 String title = "Naive Recursive Fibonacci";
84
85 // Convert "times" (in seconds) and "opCounts" to nanoseconds / op
86 List<Double> timesUsPerOp = new ArrayList<>();
87 for (int i = 0; i < td.getTimes().size(); i++) {
88 timesUsPerOp.add(td.getTimes().get(i) / td.getOpCounts().get(i) * 1e6);
89 }
90
91 printTimingTable(td);
92
93 XYChart chart = QuickChart.getChart(title, "N", "time (us per op)", "Time", td.getNs(), timesUsPerOp);
94 new SwingWrapper(chart).displayChart();
95 }
96}

Callers

nothing calls this directly

Calls 8

getTimesMethod · 0.95
getOpCountsMethod · 0.95
printTimingTableMethod · 0.95
getNsMethod · 0.95
displayChartMethod · 0.80
sizeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected