Add benchmark for GDS-rendering. Will be removed later
This commit is contained in:
parent
df7cc6d0fc
commit
bd97ccf44f
@ -43,6 +43,8 @@
|
|||||||
#include <gds-render/geometric/cell-geometrics.h>
|
#include <gds-render/geometric/cell-geometrics.h>
|
||||||
#include <gds-render/version.h>
|
#include <gds-render/version.h>
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
enum gds_render_gui_signal_sig_ids {SIGNAL_WINDOW_CLOSED = 0, SIGNAL_COUNT};
|
enum gds_render_gui_signal_sig_ids {SIGNAL_WINDOW_CLOSED = 0, SIGNAL_COUNT};
|
||||||
|
|
||||||
static guint gds_render_gui_signals[SIGNAL_COUNT];
|
static guint gds_render_gui_signals[SIGNAL_COUNT];
|
||||||
@ -148,6 +150,10 @@ static void on_load_gds(gpointer button, gpointer user)
|
|||||||
GString *mod_date;
|
GString *mod_date;
|
||||||
GString *acc_date;
|
GString *acc_date;
|
||||||
unsigned int cell_error_level;
|
unsigned int cell_error_level;
|
||||||
|
int repeat;
|
||||||
|
clock_t start_time;
|
||||||
|
clock_t end_time;
|
||||||
|
double time_spent;
|
||||||
|
|
||||||
self = RENDERER_GUI(user);
|
self = RENDERER_GUI(user);
|
||||||
if (!self)
|
if (!self)
|
||||||
@ -178,7 +184,13 @@ static void on_load_gds(gpointer button, gpointer user)
|
|||||||
clear_lib_list(&self->gds_libraries);
|
clear_lib_list(&self->gds_libraries);
|
||||||
|
|
||||||
/* Parse new GDSII file */
|
/* Parse new GDSII file */
|
||||||
gds_result = parse_gds_from_file(filename, &self->gds_libraries);
|
start_time = clock();
|
||||||
|
for (repeat = 0; repeat < 3; repeat++)
|
||||||
|
gds_result = parse_gds_from_file(filename, &self->gds_libraries);
|
||||||
|
|
||||||
|
end_time = clock();
|
||||||
|
time_spent = ((double)(end_time - start_time)) / CLOCKS_PER_SEC;
|
||||||
|
printf("Time needed for three rounds: %lf sec\n", time_spent);
|
||||||
|
|
||||||
/* Delete file name afterwards */
|
/* Delete file name afterwards */
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user