Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (10 sloc) 298 Bytes
import System.GlobalLock
import Control.Concurrent.MVar
import Criterion.Main
main :: IO ()
main = do
mVar <- newMVar ()
defaultMain
[ bench "bare" $ (return () :: IO ())
, bench "MVar" $ withMVar mVar (const $ return ())
, bench "global" $ lock (return ()) ]