Calculating the total time taken for mutation
Hi I have a function for mutation, and I want to know the total time taken for the function to execute.
That is, the difference between the time from onSuccess and start of the function.
Currently what I am doing is returning the start time from the mutation function and accessing it in the data on onSuccess function,
Something like on :
Is there any better way to handle this or can we access the total time taken or something?
3 Replies
cloudy-cyan•2y ago
start the timer in onMutate
return it from onMutate
then it will be available in onSuccess
flat-fuchsia•2y ago
Is this not a feature of the devtools? That could be an interesting addition
wise-whiteOP•2y ago
Yes I think in devtools we can get the time