%% timer:tc(fun()->lists:foreach(fun(L)-> bin_to_hex:bin_to_hex(term_to_binary(atom)) end, lists:seq(0,1000000))end). %% timer:tc(fun()->lists:foreach(fun(L)-> hello:binary_to_hex(term_to_binary(atom)) end, lists:seq(0,1000000))end). 结果显示 bin_to_hex模块里的方法 要快一些