Exection time monitor added (printf the result)
This commit is contained in:
@@ -16,7 +16,11 @@
|
|||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
|
#define MONITOR_EXEC_TIME 1
|
||||||
|
#if MONITOR_EXEC_TIME != 0
|
||||||
|
#include <time.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif
|
||||||
/**********************
|
/**********************
|
||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
@@ -188,6 +192,10 @@ static void lv_refr_areas(void)
|
|||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
|
#if MONITOR_EXEC_TIME != 0
|
||||||
|
clock_t start = clock();
|
||||||
|
#endif
|
||||||
|
|
||||||
for(i = 0; i < inv_buf_p; i++) {
|
for(i = 0; i < inv_buf_p; i++) {
|
||||||
/*Refresh the unjoined areas*/
|
/*Refresh the unjoined areas*/
|
||||||
if(inv_buf[i].joined == 0) {
|
if(inv_buf[i].joined == 0) {
|
||||||
@@ -198,9 +206,16 @@ static void lv_refr_areas(void)
|
|||||||
/*If VDB is used...*/
|
/*If VDB is used...*/
|
||||||
lv_refr_area_with_vdb(&inv_buf[i].area);
|
lv_refr_area_with_vdb(&inv_buf[i].area);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MONITOR_EXEC_TIME != 0
|
||||||
|
if(inv_buf_p != 0) {
|
||||||
|
clock_t end = clock();
|
||||||
|
float time_spent = (float)(end - start) / CLOCKS_PER_SEC;
|
||||||
|
printf("Exec time: %08f ms\n", (float)time_spent * 1000);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LV_VDB_SIZE == 0
|
#if LV_VDB_SIZE == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user