Skip to content

Instantly share code, notes, and snippets.

@whilo
Created November 26, 2014 16:54
Show Gist options
  • Save whilo/0d057728f1fe446f19d8 to your computer and use it in GitHub Desktop.
Save whilo/0d057728f1fe446f19d8 to your computer and use it in GitHub Desktop.
(ns async.naive-bench
(:require [clojure.core.async :as async
:refer [<! <!! >! timeout chan alt! go put! filter< map< go-loop]]))
(def test-ch (chan))
(loop []
(put! test-ch (System/currentTimeMillis))
(Thread/sleep 0 5)
(recur))
(future
(loop []
(println "Delta " (- (System/currentTimeMillis) (<!! test-ch)) " ms")
(recur)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment