Skip to content

Instantly share code, notes, and snippets.

@blt
Last active December 31, 2015 04:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save blt/7934150 to your computer and use it in GitHub Desktop.
Save blt/7934150 to your computer and use it in GitHub Desktop.
-module(lolspeed).
-export([main/0]).
-define(LOLEND, 1000000).
%% > lolspeed:main().
%% = {10354,ok}
%% == {10991,ok}
%% =:= {8509,ok}
main() ->
io:format("= ~p~n", [timer:tc(fun bindeq/1, [0])]),
io:format("== ~p~n", [timer:tc(fun eqeq/1, [0])]),
io:format("=:= ~p~n", [timer:tc(fun eqcoloneq/1, [0])]).
bindeq(?LOLEND) ->
ok;
bindeq(N) ->
3.0 = 3.0,
bindeq(N+1).
eqeq(?LOLEND) ->
ok;
eqeq(N) ->
true = (3.0 == 3.0),
eqeq(N+1).
eqcoloneq(?LOLEND) ->
ok;
eqcoloneq(N) ->
true = (3.0 =:= 3.0),
eqcoloneq(N+1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment