I have a file mkList.txt (but my mkList, have 100 lists with 100 numbers)
[[22,4,55,7],[77,3,66,23],[44,56,23,90]]
And
I need to know the time that Erlang uses to read the file list using
map/sort and pmap/sort. I did this:
-module(teste).
-export([teste/1]).
-import(lists, [map/2]).
-import(lib_misc, [pmap/2]).
teste(1) ->
{ok, [Data]} = file:consult("mkList1.txt"),
{Time1, T} = timer:tc(lists, map, [fun lists:sort/1,Data]),
{Time2, R} = timer:tc(lib_misc, pmap, [fun lists:sort/1,Data]),
{Time1, T, Time2, R}.
The question is what is wrong in my code, it seems to me that is not
calculating the time correctly.
Time1 = 15000
Time 2 = 1.
Could anyone help me?
Thanks.
Em 16 de outubro de 2010 13:30, Gilmara Pompelli
<gilmaram...@gmail.com> escreveu:
2010/10/18 Reza Moussavi <reza.m...@gmail.com>:
I did what you said, ran the program with two lists and two elements,
the result is here.
20> teste:teste(1).
{1,[[10,20],[2,30]],1,[[10,20],[2,30]]}
Thanks
2010/10/18 Reza Moussavi <reza.m...@gmail.com>:
2010/10/21 Reza Moussavi <reza.m...@gmail.com>:
2010/10/21 Reza Moussavi <reza.m...@gmail.com>:
{Sort, Time1/1000000}
Return
1.0e-6
Thanks
2010/10/22 Gilmara Pompelli <gilmaram...@gmail.com>: