File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,55 +103,3 @@ function benchmark(): void {
103103}
104104
105105benchmark ( ) ;
106-
107- function benchmark ( ) : void {
108- console . log ( '\nSVG Benchmark Results\n' ) ;
109-
110- for ( const theme of themes ) {
111- const times : number [ ] = [ ] ;
112-
113- // warmup
114- generateSVG (
115- stats ,
116- {
117- ...baseParams ,
118- bg : theme . bg ,
119- accent : theme . accent ,
120- text : theme . text ,
121- } ,
122- calendar
123- ) ;
124-
125- for ( let i = 0 ; i < 20 ; i ++ ) {
126- const start = performance . now ( ) ;
127-
128- generateSVG (
129- stats ,
130- {
131- ...baseParams ,
132- bg : theme . bg ,
133- accent : theme . accent ,
134- text : theme . text ,
135- } ,
136- calendar
137- ) ;
138-
139- const end = performance . now ( ) ;
140-
141- times . push ( end - start ) ;
142- }
143-
144- const avg = times . reduce ( ( a , b ) => a + b , 0 ) / times . length ;
145-
146- const min = Math . min ( ...times ) ;
147- const max = Math . max ( ...times ) ;
148-
149- console . log ( `Theme: ${ theme . name } ` ) ;
150- console . log ( `Average: ${ avg . toFixed ( 2 ) } ms` ) ;
151- console . log ( `Min: ${ min . toFixed ( 2 ) } ms` ) ;
152- console . log ( `Max: ${ max . toFixed ( 2 ) } ms` ) ;
153- console . log ( '--------------------------' ) ;
154- }
155- }
156-
157- benchmark ( ) ;
You can’t perform that action at this time.
0 commit comments