From 6c033fc8e977300800be56ae80dfd722f91c38de Mon Sep 17 00:00:00 2001 From: bdemsky Date: Sat, 14 Nov 2009 11:23:19 +0000 Subject: [PATCH] difference in how time were recorded --- Robust/src/Benchmarks/SingleTM/KMeans/GlobalArgs.java | 2 ++ Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java | 6 ++---- Robust/src/Benchmarks/SingleTM/KMeans/Normal.java | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Robust/src/Benchmarks/SingleTM/KMeans/GlobalArgs.java b/Robust/src/Benchmarks/SingleTM/KMeans/GlobalArgs.java index 813f6f8a..89cded00 100644 --- a/Robust/src/Benchmarks/SingleTM/KMeans/GlobalArgs.java +++ b/Robust/src/Benchmarks/SingleTM/KMeans/GlobalArgs.java @@ -75,4 +75,6 @@ public class GlobalArgs { public float global_delta; + long global_time; + } diff --git a/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java b/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java index 1bd4e17b..ecdabd5a 100644 --- a/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java +++ b/Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java @@ -252,7 +252,6 @@ public class KMeans extends Thread { System.out.println("Finished Starting threads......"); - long start=System.currentTimeMillis(); for (int i = 0; i < nloops; i++) { /* * Since zscore transform may perform in cluster() which modifies the @@ -271,9 +270,8 @@ public class KMeans extends Thread { kms, //main class that holds users inputs from command prompt and output arrays that need to be filled g_args); // Global arguments common to all threads } - long stop=System.currentTimeMillis(); - long diff=stop-start; - System.out.println("TIME="+diff); + + System.out.println("TIME="+g_args.global_time); System.out.println("Printing output......"); System.out.println("Best_nclusters= " + kms.best_nclusters); diff --git a/Robust/src/Benchmarks/SingleTM/KMeans/Normal.java b/Robust/src/Benchmarks/SingleTM/KMeans/Normal.java index cf44e3f6..f94ecea1 100644 --- a/Robust/src/Benchmarks/SingleTM/KMeans/Normal.java +++ b/Robust/src/Benchmarks/SingleTM/KMeans/Normal.java @@ -198,6 +198,8 @@ public class Normal { float[][] new_centers = new float[nclusters][nfeatures]; int loop = 0; + + long start=System.currentTimeMillis(); do { delta = 0.0f; @@ -232,6 +234,8 @@ public class Normal { delta /= npoints; } while ((delta > threshold) && (loop++ < 500)); + long stop=System.currentTimeMillis(); + args.global_time+=(stop-start); return clusters; } -- 2.34.1