def timer(): t1 = read_timestamp() start = time.time() while time.time() - start < 0.1: # busy wait pass t2 = read_timestamp() return t2 - t1
def do_read_timestamp(cpu, _): x = read_timestamp() if longlong.is_64_bit: assert isinstance(x, int) # 64-bit return BoxInt(x) else: assert isinstance(x, r_longlong) # 32-bit return BoxFloat(x)
def do_read_timestamp(cpu, _): x = read_timestamp() if longlong.is_64_bit: assert is_valid_int(x) # 64-bit return BoxInt(x) else: assert isinstance(x, r_longlong) # 32-bit return BoxFloat(x)
def op_ll_read_timestamp(): from pypy.rlib.rtimer import read_timestamp return read_timestamp()