Return the time step set by the most recent call to :func:`gfsstp`.

    http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfstep_c.html

    :param time: Ignored ET value.
    :type time: float
    :return: Time step to take.
    :rtype: float
547331
def gfstep(time):
    
    time = ctypes.c_double(time)
    step = ctypes.c_double()
    libspice.gfstep_c(time, ctypes.byref(step))
    return step.value
743360
def max_intensity(self, time):
        
        ti = np.where(time == self.times)[0][0]
        return self.timesteps[ti].max()
959258
def time_to_number(self, time):
        
        if not isinstance(time, datetime.time):
            raise TypeError(time)
        return ((time.second / 60.0 + time.minute) / 60.0 + time.hour) / 24.0
998429
def get_times(self):
        
        send_time = ctypes.c_int32()
        recv_time = ctypes.c_int32()
        result = self.library.Par_GetTimes(self.pointer, ctypes.byref(send_time),
                                   ctypes.byref(recv_time))
        check_error(result, "partner")
        return send_time, recv_time
1223539
def T(t, step=30):
    
    if hasattr(t, 'timestamp'):
        timestamp = t.timestamp()
    else:
        # python 2
        if t.tzinfo is None:
            timestamp = time.mktime(t.timetuple())
        else:
            utc_naive  = t.replace(tzinfo=None) - t.utcoffset()
            timestamp = (utc_naive - datetime.datetime(1970, 1, 1)).total_seconds()

    return int(timestamp) // step
804345
def generate_timestamp(fmt=None):
    
    if fmt:
        time = dt.datetime.now().strftime(fmt)
    else:
        time = dt.date.today()
    return str(time)
1310816
def now (time_t = None, slug = False):
  '''
  '''
  if not time_t:
    time_t = time ()
  time_s = strftime (
    DEFAULT_SLUGFORMAT if slug else DEFAULT_TIMEFORMAT,
    gmtime (time_t))
  return (int (time_t), time_s)
770179
def timesteps(self):
        
        timesteps = []
        timed = self.et.find("timed")

        if timed is not None:
            for deploy in timed.findall("deploy"):
                timesteps.append(deploy.attrib["time"])

        return timesteps
1110428
def __timestamp():
    """"""
    today = time.time()
    ret = struct.pack(b'=L', int(today))
    return ret
503754
def _set_pseudotime(self):
        
        self.pseudotime = self.distances_dpt[self.iroot].copy()
        self.pseudotime /= np.max(self.pseudotime[self.pseudotime < np.inf])
122819
def step(self, step_size: Timedelta=None):
        
        old_step_size = self.clock.step_size
        if step_size is not None:
            if not isinstance(step_size, type(self.clock.step_size)):
                raise ValueError(f"Provided time must be an instance of {type(self.clock.step_size)}")
            self.clock._step_size = step_size
        super().step()
        self.clock._step_size = old_step_size
1280620
def set_time_items(glob):
    
    a = glob['args']
    l = glob['logger']

    class __TimeManager(object):
        def __init__(self):
            c = a._collisions
            self._stats = getattr(a, c.get("stats") or "stats", False)
            self._timings = getattr(a, c.get("timings") or "timings", False)
            self.enabled = self._stats or self._timings
            self.last = self.start = time.time()
            self.times = []
        
        def stats(self):
            end = time.time()
            b = ""
            for d, s, e in self.times:
                b += "\n{}\n> {} seconds".format(d, e - s)
            l.time("Total time: {} seconds{}".format(end - self.start, b))
    
    glob['time_manager'] = manager = __TimeManager()

    def _take_time(start=None, descr=None):
        t = manager.last = time.time()
        if start is not None and descr is not None:
            manager.times.append((descr, float(start), float(t)))
        return t - (start or 0)

    class Timer(object):
        class TimeoutError(Exception):
            pass  # TimeoutError is not handled in Python 2
    
        def __init__(self, description=None, message=TO_MSG, timeout=None,
                     fail_on_timeout=False):
            self.fail = fail_on_timeout
            self.id = len(manager.times)
            self.descr = "#" + str(self.id) + \
                         (": " + (description or "")).rstrip(": ")
            self.message = message
            self.start = _take_time()
            self.timeout = timeout

        def __enter__(self):
            if manager.enabled:
                if self.timeout is not None:
                    signal.signal(signal.SIGALRM, self._handler)
                    signal.alarm(self.timeout)
                if manager._timings and self.descr:
                    l.time(self.descr)
                return self
        
        def __exit__(self, exc_type, exc_value, exc_traceback):
            if manager.enabled:
                d = _take_time(self.start, self.descr)
                if manager._timings:
                    l.time("> Time elapsed: {} seconds".format(d))
                if self.timeout is not None:
                    if self.fail and exc_type is Timer.TimeoutError:
                        return True

        def _handler(self, signum, frame):
            raise Timer.TimeoutError(self.message)
    
    glob['Timer'] = Timer
    
    def get_time(message=None, start=manager.start):
        if manager._timings:
            l.time("> {}: {} seconds".format(message or "Time elapsed since "
                                          "execution start", _take_time(start)))
    
    glob['get_time'] = get_time
    
    def get_time_since_last(message=None):
        get_time(message or "Time elapsed since last measure", manager.last)
    
    glob['get_time_since_last'] = get_time_since_last
127779
def _ligotimegps(s, ns=0):
    
    from lal import LIGOTimeGPS
    try:
        return LIGOTimeGPS(s, ns)
    except TypeError:
        return LIGOTimeGPS(int(s), int(ns))
562081
def getTimestampUTC():
    
    utc     = datetime.datetime.utcnow()
    ts_sec  = calendar.timegm( utc.timetuple() )
    ts_usec = utc.microsecond
    return ts_sec, ts_usec
753653
def get_time(self):
        ''''''
        systime = time.time() - self.mpstate.start_time_s
        if not self.mpstate.is_sitl:
            return systime
        try:
            speedup = int(self.get_mav_param('SIM_SPEEDUP',1))
        except Exception:
            return systime
        if speedup != 1:
            return self.mpstate.attitude_time_s
        return systime
1084135
def get_total_time(self):
        
        first_step = self.steps[0]
        last_step = self.steps[-1]
        seconds = self.history[last_step]["__timestamp__"] \
                  - self.history[first_step]["__timestamp__"]
        return datetime.timedelta(seconds=seconds)
734298
def time_func(func):
    
    def timed(*args, **kwargs):
        ts = time.time()
        result = func(*args, **kwargs)
        secs = time.time() - ts
        ops_ps = kwargs.get('operations', secs) / secs
        print ("finc{} took: {} {:2.4f} operations/sec={:5.2f}".format(func.__name__, seconds_to_DHMS(secs), secs, ops_ps))
        return result
    return timed