Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (20 sloc) 0.762 kb
module Y = Yojson
let id (x : 'a) : 'a = x
let channel_get_lines (channel : in_channel) : string list =
let rec get_lines_acc (return : string list -> string list)
(channel : in_channel)
: string list =
let x = try Some (input_line channel) with End_of_file -> None
in match x with
| None -> return []
| Some h -> get_lines_acc (fun result -> return (h :: result)) channel
in get_lines_acc id channel
let () =
let ss = String.concat "\n" (channel_get_lines stdin) in
let t0 = Unix.gettimeofday () in
let json = Y.Basic.from_string ss in
let t1 = Unix.gettimeofday ()
in begin
print_endline (Y.Basic.to_string json);
print_endline (string_of_float (t1 -. t0))
end
Jump to Line
Something went wrong with that request. Please try again.