(* Open a common binary, single step for a while. Calculates single-step speed. *) let steptest () = let sctl = Sctl.create_local() in (* let sctl = Sctl.create_remote "127.0.0.1" 30000 in *) let (prog,ctx) = Sctl.launch sctl [Sctl.Fstdout] ["/bin/ls" ; "/"] in let numsteps = 500 in let before_time = Unix.gettimeofday() in for i = 0 to numsteps do ignore(Sctl.step prog) done; let after_time = Unix.gettimeofday() in let diff_time = after_time -. before_time in Printf.printf "%f secs for %d steps. %f steps/sec\n" diff_time numsteps ((float numsteps) /.diff_time); flush stdout; Sctl.cont_to_exit prog; Sctl.close sctl ;; steptest()