nrepl 2025-04-16

What I'm doing wrong to get the time spent to handle a eval?

✅ 1

for a code like this:

(do
  (Thread/sleep 1000)
  (+ 1 2))
I get 1 ms

I suspect the eval is done async... if so, how to measure that?

Yes, evals happen in a different thread (a "session" thread)

Do you see any way to workaround that?

• Remember start time in the middleware wrapper • Update transport to intercept responses, wait for a :done response, that's where you take the end time

Ahh that makes sense, I do something similar in other middleware and didn't realize I could wait for done, awesome

Does that happens for other ops? Like load-file?

I mean, what others should I be aware of this async behavior

Can't tell you off the top of my head, you better check for yourself. load-file is a probable one

Will do, thank you!

that worked perfectly, thanks!

👍 2