calculating the time taken for the creation of the graph