File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
apps/kyberswap-interface/src/pages/CrossChainSwap/hooks Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,10 @@ export const CrossChainSwapRegistryProvider = ({ children }: { children: React.R
609609 setLoading ( true )
610610 setAllLoading ( true )
611611
612+ // Track quote fetching time
613+ const quoteStartTime = performance . now ( )
614+ console . log ( '[Quote Timing] Starting to fetch quotes...' )
615+
612616 const getQuotesWithCancellation = async ( params : QuoteParams | NearQuoteParams ) => {
613617 const quotes : Quote [ ] = [ ]
614618
@@ -925,6 +929,18 @@ export const CrossChainSwapRegistryProvider = ({ children }: { children: React.R
925929 } finally {
926930 setLoading ( false )
927931 setAllLoading ( false )
932+
933+ // Log total time taken to fetch all quotes
934+ const quoteEndTime = performance . now ( )
935+ const totalTime = quoteEndTime - quoteStartTime
936+ const tokenInSymbol = ( currencyIn as any ) ?. symbol || ( currencyIn as any ) ?. wrapped ?. symbol || 'Unknown'
937+ const tokenOutSymbol = ( currencyOut as any ) ?. symbol || ( currencyOut as any ) ?. wrapped ?. symbol || 'Unknown'
938+ console . log (
939+ `[Quote Timing] All quotes fetched and processed. ${ amount } ${ tokenInSymbol } -> ${ tokenOutSymbol } . Total time: ${ totalTime . toFixed (
940+ 2 ,
941+ ) } ms (${ ( totalTime / 1000 ) . toFixed ( 2 ) } s)`,
942+ )
943+ console . log ( `[Quote Timing] Number of quotes received: ${ quotes . length } ` )
928944 }
929945 } , [
930946 sender ,
You can’t perform that action at this time.
0 commit comments