File tree Expand file tree Collapse file tree 1 file changed +0
-14
lines changed Expand file tree Collapse file tree 1 file changed +0
-14
lines changed Original file line number Diff line number Diff line change @@ -119,24 +119,10 @@ describe("tiktoken", () => {
119119
120120 const content : Anthropic . Messages . ContentBlockParam [ ] = [ { type : "text" , text : "Hello world" } ]
121121
122- // Time the first call which should create the encoder
123- const startTime1 = performance . now ( )
124122 const result1 = await tiktoken ( content )
125- const endTime1 = performance . now ( )
126- const duration1 = endTime1 - startTime1
127-
128- // Time the second call which should reuse the encoder
129- const startTime2 = performance . now ( )
130123 const result2 = await tiktoken ( content )
131- const endTime2 = performance . now ( )
132- const duration2 = endTime2 - startTime2
133124
134125 // Both calls should return the same token count
135126 expect ( result1 ) . toBe ( result2 )
136-
137- // This is a loose test and might occasionally fail due to system load,
138- // but generally the second call should be faster or similar in speed
139- // since it reuses the encoder
140- expect ( duration2 ) . toBeLessThanOrEqual ( duration1 * 1.5 )
141127 } )
142128} )
You can’t perform that action at this time.
0 commit comments