(*)add a function for template generation to compare time elapsed