cleaned and finished get_latency
totaly finished with get_latency and its run_prgs