So the perceived problem is that developers might be confused whether the 
timing is emitted by the entered expression or is provided by IEx.

One way that might help with that problem is consistency. If a developer always 
sees the timing, even when it's practically 0us, they don't need to guess 
whether it's genuine output or produced by IEx.

Another way is to display the timing of the previous expression *inside* the 
prompt, there should be no such confusion. Some repls also allow multiline 
prompts, and if its easy to identify their beginnings, there should be no 
confusion.

We could also extend the feature to provide some other details, e.g. number of 
messages in the process queue (as an advice to use flush), amount of memory 
needed to hold the produced value, and maybe something else.


On 18 October 2019 8:07:33 am AEDT, Fernando Tapia Rico <fertap...@gmail.com> 
wrote:
>I like the idea too, but I'm concerned about printing unexpected
>messages 
>in the REPL, users might not know where those messages are coming from.
>
>
>As an alternative, I would like to suggest adding a new IEx helper
>t/0,1 
>that would return the execution time of the previous command or the nth
>
>command (similar to v/0,1).
>
>
>On Thursday, October 17, 2019 at 10:10:49 PM UTC+2, José Valim wrote:
>>
>> I like this idea. A PR would be welcome. What should be the default 
>> trigger? 5s?
>>
>> On Wednesday, August 7, 2019 at 12:51:17 AM UTC+2, Exempll wrote:
>>>
>>>
>>>   This would be a neat detail. It is easy to forget to time a 
>>> long-running function, and sometimes, when you are surprised by the
>running 
>>> time, you want to know how long it ran for in retrospect. Something
>like 
>>> `[iex] OK time=4.1s` right before the next prompt. It wouldn't need
>to be 
>>> displayed for every command, but possibly just for the commands that
>pass a 
>>> certain running time threshold.
>>>
>>
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "elixir-lang-core" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to elixir-lang-core+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/elixir-lang-core/9dc355ff-e59e-48a1-84e6-75f0e0151287%40googlegroups.com.

-- 
Kind regards,
Dmitry Belyaev

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/5BB42249-4817-4787-AEDB-531CB41D22F8%40gmail.com.

Reply via email to