Ejemplo n.º 1
0
 def stop(self):
     if self.watch == ffi.NULL:
         raise ZMQError('Must start the Stopwatch before calling stop.')
     else:
         time = C.zmq_stopwatch_stop(self.watch)
         self.watch = ffi.NULL
         return time
Ejemplo n.º 2
0
 def stop(self):
     if self.watch == ffi.NULL:
         raise ZMQError('Must start the Stopwatch before calling stop.')
     else:
         time = C.zmq_stopwatch_stop(self.watch)
         self.watch = ffi.NULL
         return time
Ejemplo n.º 3
0
    def test_zmq_stopwatch_functions(self):
        from zmq.cffi_core._cffi import C, ffi

        stopwatch = C.zmq_stopwatch_start()
        ret = C.zmq_stopwatch_stop(stopwatch)

        assert ffi.NULL != stopwatch
        assert 0 < int(ret)