Ambiguous assignment in erlang using date & time
I'm following Programming in Erlang, Software for a concurrent world written by Joe Armstrong and I am trying to figure out what is asking me solve as an assignment at the end of the sequential chapter. Here is the assignment:
Look up the definitions of erlang:now/0
erlang:date/0
and erlang:time/0
. Write a function called `my_time_func(F), which evaluates the fun F and times how long it takes.
I don't understand what the assignment is asking me to do. Can you give me examples of the output given different arguments or maybe another explanation?
它希望你编写一个函数来计算运行另一个函数需要多长时间。
my_time_fun:my_time_fun(fun() -> io:format("hi!~n") end).
hi!
This function took 0 megaseconds, 0 seconds, and 54 microseconds to complete
ok
链接地址: http://www.djcxy.com/p/66292.html
上一篇: Erlang队列行为不一致