Here i have used the interface "LocalTime" and component "LocalTimeMilliC" for calculating the execution time.
This is the Configuration for calculating the execution time. Here i have given a sample code and it is not complete in sense of a complete application.
This is the module for the application.
This is the Configuration for calculating the execution time. Here i have given a sample code and it is not complete in sense of a complete application.
configuration TMP102AppC {
}
implementation {
components LocalTimeMilliC, TMP102C as App;
App.LocalTime -> LocalTimeMilliC;
---Other Configurations---
}
This is the module for the application.
#include "printf.h"
module TMP102C {
uses interface LocalTime <tmilli>;
---Other Interfaces---
}
implementation {
uint32_t start_time;
uint32_t stop_time;
---Other Code---
start_time = call LocalTime.get(); // Put this line where you want to start count.
---Other Code---
stop_time = call LocalTime.get(); // Put this line where you want to stop count.
printf("Execution Time = %d\n",(stop_time-start_time)); //Print the execution time.
}
Hi,
ReplyDeleteI tried doing the steps specified above. However, I am getting 0 on doing call LocalTime.get(); Please let me know if it is working for you or if there is some other method to calculate the execution time.