difference in how time were recorded
authorbdemsky <bdemsky>
Sat, 14 Nov 2009 11:23:19 +0000 (11:23 +0000)
committerbdemsky <bdemsky>
Sat, 14 Nov 2009 11:23:19 +0000 (11:23 +0000)
Robust/src/Benchmarks/SingleTM/KMeans/GlobalArgs.java
Robust/src/Benchmarks/SingleTM/KMeans/KMeans.java
Robust/src/Benchmarks/SingleTM/KMeans/Normal.java

index 813f6f8a806ac4ca8a86092383b67ad6a03a4190..89cded00186d19e56ef0457dd4d44a2cfa2d3891 100644 (file)
@@ -75,4 +75,6 @@ public class GlobalArgs {
 
   public float global_delta;
 
+  long global_time;
+
 }
index 1bd4e17b643d5da62737451cf738bc90c5525c2a..ecdabd5a9fb98f6c815a9b127437a7cd27dc30d5 100644 (file)
@@ -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);
index cf44e3f68dac37c4c0bbe46703aa615c0bf34283..f94ecea1a49eb54b2e6bb633f3ba1c1bb0777e16 100644 (file)
@@ -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;
   }