]> rtime.felk.cvut.cz Git - frescor/fosa.git/commitdiff
Better measuring loop execution time
authortelleriam <telleriam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Fri, 23 Nov 2007 17:27:36 +0000 (17:27 +0000)
committertelleriam <telleriam@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Fri, 23 Nov 2007 17:27:36 +0000 (17:27 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@883 35b4ef3e-fd22-0410-ab77-dab3279adceb

src_marte/tests/test_non_local_jump/testbench_long_jump.c

index 9103fb80b6fc5082eeb24cfb19ad8c04e25562c6..3fb9e6763be647badb8d78ff12889afa217d79f6 100644 (file)
@@ -75,9 +75,6 @@ static void *periodic_code(void *thread_arg)
     int terror = -1;
 
     struct timespec period = {2, 500000000};  // 2.5 secs
-    struct timespec activation_time = {-1, -1};
-    struct timespec old_activation_time = {-1, -1};
-
     frsh_thread_id_t jump_handler_thread;
 
     frsh_signal_t jump_signal;
@@ -113,18 +110,24 @@ static void *periodic_code(void *thread_arg)
                                           &jump_timer, jump_handler_thread)  );
 
     
-    /* For statistical purposes we read the activation time */
-    PXW(  fosa_clock_get_time(FOSA_CLOCK_REALTIME, &activation_time) );
-    
     /* Periodic loop */
     /*****************/
     while (1)
     {
         int jumped = -1;
         struct timespec budget = {1, 400000000};  // 1.4 secs
+        struct timespec activation_time = {-1, -1};
+        struct timespec old_activation_time = {-1, -1};
+
+
 
         jumped = 0;
 
+        /* For statistical purposes we read the activation time */
+        PXW(  fosa_clock_get_time(FOSA_CLOCK_REALTIME, &activation_time) );
+
+
+
         /* Start of the interruptible block */
         /************************************/
 
@@ -157,7 +160,7 @@ static void *periodic_code(void *thread_arg)
         /*************************************************/
         PXW(  fosa_clock_get_time(FOSA_CLOCK_REALTIME, &old_activation_time)  );
         decr_timespec(&old_activation_time, &activation_time);
-        printf("End   thrad %6.3f\n", t2d(old_activation_time) );
+        printf("Execution time: %6.3f\n", t2d(old_activation_time) );
     
         /* And we program the next loop */
         incr_timespec(&activation_time, &period);