returns current time of simulation
439216
def get_current_time(self):
        
        current_time = c_double()
        self.library.get_current_time.argtypes = [POINTER(c_double)]
        self.library.get_current_time.restype = None
        self.library.get_current_time(byref(current_time))
        return current_time.value
107107
public RectF getInterpolatedRect(long elapsedTime) {
        float elapsedTimeFraction = elapsedTime / (float) mDuration;
        float interpolationProgress = Math.min(elapsedTimeFraction, 1);
        float interpolation = mInterpolator.getInterpolation(interpolationProgress);
        float currentWidth = mSrcRect.width() + (interpolation * mWidthDiff);
        float currentHeight = mSrcRect.height() + (interpolation * mHeightDiff);

        float currentCenterX = mSrcRect.centerX() + (interpolation * mCenterXDiff);
        float currentCenterY = mSrcRect.centerY() + (interpolation * mCenterYDiff);

        float left = currentCenterX - (currentWidth / 2);
        float top = currentCenterY - (currentHeight / 2);
        float right = left + currentWidth;
        float bottom = top + currentHeight;

        mCurrentRect.set(left, top, right, bottom);
        return mCurrentRect;
    }
865344
def get_time_evolution(self):
        
        term = self.simplify()
        coeff = term.coeff
        if coeff.imag:
            raise ValueError("Not a real coefficient.")
        ops = term.ops
        def append_to_circuit(circuit, t):
            if not ops:
                return
            for op in ops:
                n = op.n
                if op.op == "X":
                    circuit.h[n]
                elif op.op == "Y":
                    circuit.rx(-half_pi)[n]
            for i in range(1, len(ops)):
                circuit.cx[ops[i-1].n, ops[i].n]
            circuit.rz(-2 * coeff * t)[ops[-1].n]
            for i in range(len(ops)-1, 0, -1):
                circuit.cx[ops[i-1].n, ops[i].n]
            for op in ops:
                n = op.n
                if op.op == "X":
                    circuit.h[n]
                elif op.op == "Y":
                    circuit.rx(half_pi)[n]
        return append_to_circuit
586109
def gettime
      Sidetiq.config.utc ? Time.now.utc : (Time.respond_to?(:current) ? Time.current : Time.now)
    end
730651
def Timestamp():
    
    timestamp = ''
    try:
        timestamp = str(datetime.datetime.now())+' UTC'
    except Exception as e:  # pragma: no cover
        logger.error('Could not get current time ' + str(e))
    return timestamp
1005938
def currentDateTime(self):
        
        view = self.uiGanttVIEW
        scene = view.scene()
        point = view.mapToScene(0, 0)
        return scene.datetimeAt(point.x())
482082
def get(self):
        
        now = datetime.now()
        if self._start_time:
            if self._stop_time:
                return (self._stop_time - self._start_time).total_seconds()
            return (now - self._start_time).total_seconds()
        return 0.
988585
def getChargeTimeElapsed(self):
    """"""
    command = '$GS'
    status = self.sendCommand(command)
    if int(status[1]) == 3:
      return int(status[2])
    else:
      return 0
1341982
def report(self, simulation, state):
        
        if not self._initialized:
            self._initial_clock_time = datetime.now()
            self._initial_simulation_time = state.getTime()
            self._initial_steps = simulation.currentStep
            self._initialized = True

        steps = simulation.currentStep
        time = datetime.now() - self._initial_clock_time
        days = time.total_seconds()/86400.0
        ns = (state.getTime()-self._initial_simulation_time).value_in_unit(u.nanosecond)

        margin = ' ' * self.margin
        ns_day = ns/days
        delta = ((self.total_steps-steps)*time.total_seconds())/steps
        # remove microseconds to have cleaner output
        remaining = timedelta(seconds=int(delta))
        percentage = 100.0*steps/self.total_steps
        if ns_day:
            template = '{}{}/{} steps ({:.1f}%) - {} left @ {:.1f} ns/day                    \r'
        else:
            template = '{}{}/{} steps ({:.1f}%)                                              \r'
        report = template.format(margin, steps, self.total_steps, percentage, remaining, ns_day)
        self._out.write(report)
        if hasattr(self._out, 'flush'):
            self._out.flush()
929698
def get_float_time():
    '''

    '''
    t1 = time.time()
    t2 = datetime.datetime.fromtimestamp(t1)
    return time.mktime(t2.timetuple()) + 1e-6 * t2.microsecond
1249713
private void validateAndSetClock(long newSimulationTime) {
     
    // We do not use the getClock routine here as 
    // the Engine and JobTracker clocks are different at
    // this point.
    long currentSimulationTime = clock.getTime();   
    if (newSimulationTime < currentSimulationTime) {
      // time has gone backwards
      throw new IllegalArgumentException("Time has gone backwards! " +
                                 "newSimulationTime: " + newSimulationTime +
                                 " while currentTime: " + 
                                 currentSimulationTime);
    }
    // the simulation time should also match that in the engine
    assert(newSimulationTime == engine.getCurrentTime()) : 
    	     " newTime =" + newSimulationTime + 
    	     " engineTime = " + engine.getCurrentTime();

    // set the current simulation time
    clock.setTime(newSimulationTime);
  }
871446
def epoch(self):

        ''' 
        '''

    # construct epoch timestamp from labDT
        epoch_dt = datetime.utcfromtimestamp(0).replace(tzinfo=pytz.utc)
        delta_time = self - epoch_dt
        return delta_time.total_seconds()
216497
def elapsed_time_s(self):
        
        if self._start_time:
            return (datetime.datetime.now() - self._start_time).total_seconds()
        else:
            return 0
1352209
def _update_simulation_end_from_lsm(self):
        
        te = self.l2g.xd.lsm.datetime[-1]
        simulation_end = te.replace(tzinfo=utc) \
                           .astimezone(tz=self.tz) \
                           .replace(tzinfo=None)

        if self.simulation_end is None:
            self.simulation_end = simulation_end
        elif self.simulation_end > simulation_end:
            self.simulation_end = simulation_end
        self._update_card("END_TIME",
                          self.simulation_end
                              .strftime("%Y %m %d %H %M"))
735970
@Override
    public Moment currentTime() {

        if ((this.monotonic || MONOTON_MODE) && LeapSeconds.getInstance().isEnabled()) {
            long nanos = this.utcNanos();
            return Moment.of(Math.floorDiv(nanos, MRD), (int) Math.floorMod(nanos, MRD), TimeScale.UTC);
        } else {
            long millis = System.currentTimeMillis();
            int nanos = ((int) Math.floorMod(millis, 1000)) * MIO;
            return Moment.of(Math.floorDiv(millis, 1000), nanos, TimeScale.POSIX);
        }

    }
1202019
def timethis(func):
    """"""
    func_module, func_name = func.__module__, func.__name__

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        start = _time_perf_counter()
        r = func(*args, **kwargs)
        end = _time_perf_counter()
        print('timethis : <{}.{}> : {}'.format(func_module, func_name, end - start))
        return r
    return wrapper
1172166
function getTime(ts) {
		function pad2(n) {
			return n < 10 ? '0' + n : n;
		}

		function pad3(n) {
			return n < 10 ? '00' + n : (n < 100 ? '0' + n : n);
		}

		return pad2(ts.getHours()) + ':' +
			pad2(ts.getMinutes()) + ':' +
			pad2(ts.getSeconds()) + '.' +
			pad3(ts.getMilliseconds());
	}