Expose Duration units and add a Nanoseconds function to let us build against 0.6.0
This commit is contained in:
@@ -101,7 +101,14 @@ ctypedef Promise[PyArray] PyPromiseArray
|
||||
|
||||
cdef extern from "kj/time.h" namespace " ::kj":
|
||||
cdef cppclass Duration:
|
||||
Duration(int64_t)
|
||||
Duration operator*(int64_t)
|
||||
Duration NANOSECONDS
|
||||
Duration MICROSECONDS
|
||||
Duration MILLISECONDS
|
||||
Duration SECONDS
|
||||
Duration MINUTES
|
||||
Duration HOURS
|
||||
Duration DAYS
|
||||
# cdef cppclass TimePoint:
|
||||
# TimePoint(Duration)
|
||||
cdef cppclass Timer:
|
||||
@@ -109,6 +116,9 @@ cdef extern from "kj/time.h" namespace " ::kj":
|
||||
# VoidPromise atTime(TimePoint time)
|
||||
VoidPromise afterDelay(Duration delay)
|
||||
|
||||
cdef inline Duration Nanoseconds(int64_t nanos):
|
||||
return NANOSECONDS * nanos
|
||||
|
||||
cdef extern from "kj/async-io.h" namespace " ::kj":
|
||||
cdef cppclass AsyncIoStream:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user