Did I find the right examples for you? yes no

All Samples(11)  |  Call(8)  |  Derive(0)  |  Import(3)
convert seconds to nanoseconds. If s is None, current time is
returned 

        def nanotime(s=None):
    """ convert seconds to nanoseconds. If s is None, current time is
    returned """
    if s is not None:
        return int(s) * 1000000000
    return time.time() * 1000000000
        


src/g/a/gaffer-0.5.2/gaffer/state.py   gaffer(Download)
 
from .sync import add, sub, increment, atomic_read
from .util import nanotime
 
class ProcessTracker(object):
    def check(self, process, graceful_timeout=10000000000):
        process.graceful_time = graceful_timeout + nanotime()
        heapq.heappush(self.processes, process)
 
    def uncheck(self, process):
                # graceful time set when the worker was stopped
                p = heapq.heappop(self.processes)
                now = nanotime()
                delta = p.graceful_time - now
                if delta > 0:
    def graceful_timeout(self):
        return nanotime(self.config.get('graceful_timeout', 10.0))
 
    def __str__(self):
        return "state: %s" % self.name

src/g/a/gaffer-HEAD/gaffer/state.py   gaffer(Download)
 
from .sync import add, sub, increment, atomic_read
from .util import nanotime
 
class ProcessTracker(object):
    def check(self, process, graceful_timeout=10000000000):
        process.graceful_time = graceful_timeout + nanotime()
        heapq.heappush(self.processes, process)
 
    def uncheck(self, process):
                # graceful time set when the worker was stopped
                p = heapq.heappop(self.processes)
                now = nanotime()
                delta = p.graceful_time - now
                if delta > 0:
    def graceful_timeout(self):
        return nanotime(self.config.get('graceful_timeout', 10.0))
 
    def __str__(self):
        return "state: %s" % self.name

src/o/f/offset-HEAD/offset/core/timer.py   offset(Download)
from .context import Context, park, enter_syscall
from . import proc
from .util import nanotime, nanosleep
 
 
    def start(self):
        global timers
        self.active = True
        if not self.when:
            self.when = nanotime() + self.interval
    def timerproc(self):
        while True:
            self._lock.acquire()
            now = nanotime()