This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* ocamlfind opt -linkpkg -package unix -package markup measure.ml *) | |
let measure f = | |
let open Unix in | |
let start_times = times () in | |
let start_wall = gettimeofday () in | |
f (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* ocamlfind opt -linkpkg -package lwt.ppx -package lwt.unix -package mtime.os timing.ml && ./a.out *) | |
open Lwt.Infix | |
let f1 dir = | |
let s = Lwt_unix.files_of_directory dir in | |
let s = Lwt_stream.filter (fun s -> s <> "." && s <> "..") s in | |
let s = Lwt_stream.map (Filename.concat dir) s in | |
Lwt_stream.to_list s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/uio.h> | |
#include <fcntl.h> | |
#include <sys/time.h> | |
#include <sys/times.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let take limit html = | |
let spaces = Str.regexp "[ \t\r\n]+" in | |
let rec repeat acc n v = if n > 0 then repeat (v::acc) (n - 1) v else acc in | |
let filter_signals = | |
(0, 0) | |
|> Markup.transform (fun ((seen, unclosed_elements) as state) signal -> | |
match signal with | |
| `Text ss -> |
NewerOlder