"""Injected clock experiment; does not change OS clocks or sleep."""
import json,platform,time
def remaining(deadline,now):return max(0,deadline-now)
def demo():
 wall=[1000,1003,900,1200];mono=[50,53,57,62];wd=wall[0]+10;md=mono[0]+10
 rows=[{'step':i,'wall':w,'monotonic':m,'wall_remaining':remaining(wd,w),'monotonic_remaining':remaining(md,m)} for i,(w,m) in enumerate(zip(wall,mono,strict=True))]
 assert [r['monotonic_remaining'] for r in rows]==[10,7,3,0]
 assert [r['wall_remaining'] for r in rows]==[10,7,110,0]
 info={n:{k:getattr(time.get_clock_info(n),k) for k in ['monotonic','adjustable','implementation','resolution']} for n in ['time','monotonic','perf_counter']}
 assert info['monotonic']['monotonic'] is True
 return {'runtime':platform.python_version(),'authored_budget_seconds':10,'injected_rows':rows,'actual_host_clock_info':info,'real_duration_benchmark_run':False,'worker_cancelled':False,'scope':'Only differences within one clock domain; no sleep, OS clock change, cross-restart deadline or worker interruption.'}
if __name__=='__main__':print(json.dumps(demo(),ensure_ascii=True,indent=2))
