weavejester / medley

A lightweight library of useful Clojure functions
Eclipse Public License 1.0
865 stars 66 forks source link

`time` as data? #77

Closed vemv closed 1 year ago

vemv commented 1 year ago

Hey James,

one fairly usual need I have in Clojure projects is to time things, and obtain the timing result as data.

Wrapping clojure.core/time in a with-out-str can have unintended effects and needs parsing anyway.

So a time in medley that returned [computation, timing] might not look out of place.

Cheers - V

weavejester commented 1 year ago

I think this would be better suited to a more specific profiling library. There's a lot of subtleties in correctly profiling code that I don't think fit in a more general-purpose library like Medley.