Python Implementation of ref time

From PeformIQ Upgrade
Jump to navigation Jump to search
#=====================================================================

def the_time():
   t = float(ref_time(FALSE)) * 0.001

   return t

#---------------------------------------------------------------------

def ref_time(flg):
   global start

   curr = datetime.now()

   if (flg):
      start  = curr
      t      = 0
   else:
      microsecond = (curr.microsecond - start.microsecond)
      second      = ((curr.second     - start.second) * 1000000)
      t           = (second + microsecond)/1000

   return t

#=====================================================================