File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @egoistdeveloper/twcss-to-sass" ,
3- "version" : " 2.1.16 " ,
3+ "version" : " 2.1.17 " ,
44 "description" : " HTML template to SASS converter for TailwindCSS" ,
55 "main" : " dist/cjs/index.js" ,
66 "module" : " dist/esm/index.js" ,
Original file line number Diff line number Diff line change 11export interface IConverterResult {
22 sass : string | null
33 html : string | null
4+ executionTime : string
45}
Original file line number Diff line number Diff line change @@ -678,6 +678,13 @@ export function convertToSass(
678678) : null | IConverterResult {
679679 styles = [ ]
680680
681+ let startTime = 0 ,
682+ endTime = 0
683+
684+ if ( typeof performance !== 'undefined' ) {
685+ startTime = performance . now ( )
686+ }
687+
681688 if ( html && html . length ) {
682689 if ( options ) {
683690 _defaultOptions = {
@@ -719,15 +726,25 @@ export function convertToSass(
719726 _defaultOptions . formatterOptions
720727 )
721728
729+ if ( typeof performance !== 'undefined' ) {
730+ endTime = performance . now ( )
731+ }
732+
722733 return {
723734 sass : Utils . fixFomatterApplyIssue ( formattedSassResult ) ,
724735 html : formattedHtmlResult ,
736+ executionTime : ( endTime - startTime ) . toFixed ( 2 ) + ' ms' ,
725737 }
726738 }
727739
740+ if ( typeof performance !== 'undefined' ) {
741+ endTime = performance . now ( )
742+ }
743+
728744 return {
729745 sass : sassTreeResult ,
730746 html : htmlTreeResult ,
747+ executionTime : ( endTime - startTime ) . toFixed ( 2 ) + ' ms' ,
731748 }
732749 }
733750 }
You can’t perform that action at this time.
0 commit comments