import time


def get_job_runtime( starttime, status ):
    """ Function to return runtime of current job in H:M format.
        Returns --:-- if job not running. """

    if "running" in status:
        seconds = int( time.time() - starttime ) 
        m, s = divmod( seconds, 60 )
        hours, min = divmod( m, 60 )
        Time = "%d:%02d" % ( hours, min)
    else: 
        Time = "--:--"
    return Time