mirror of
https://github.com/RustyRaptor/parallel-programming.git
synced 2026-12-03 23:55:23 -07:00
emergency sync 2
This commit is contained in:
1 parent
81fc0cc85a
commit
290d50b1f8
10 files changed
+177
-93
No files matched your search
@@ -61,10 +61,8 @@ public class CountThrees implements Runnable {
|
||||
// compute the elapsed time in nanoseconds
|
||||
long duration = (endTime - startTime);
|
||||
|
||||
// convert to seconds
|
||||
double seconds = (double)duration / 1_000_000_000.0;
|
||||
|
||||
System.out.println("Time taken: " + seconds + " seconds");
|
||||
printPerformanceMetrics("executionTime", duration);
|
||||
}
|
||||
|
||||
private int startIndex;
|
||||
@@ -76,6 +74,16 @@ public class CountThrees implements Runnable {
|
||||
elements = elem;
|
||||
}
|
||||
|
||||
|
||||
public static void printPerformanceMetrics(
|
||||
String metric,
|
||||
double value
|
||||
)
|
||||
{
|
||||
System.out.printf("\"%s\": %f%n", metric, value);
|
||||
}
|
||||
|
||||
|
||||
// Overload of run method in the Thread class
|
||||
public void run() {
|
||||
// Count the number of threes
|
||||
|
||||
Reference in new issue
Block a user