Code highlighting example

How we calculate reading times

/

April 26, 2020

(1 min read)

This is how we calculate reading times!


int one = 5; //java


function getReadingTime(content) {     
   const wordsPerMinute = 200; // Average case.    
   let result;     
   let parsedContent = convertFromRaw(JSON.parse(content)).getPlainText('\u0001');
   let textLength = parsedContent.split(" ").length; // Split by words    
   if(textLength > 0) {         
       let value = Math.ceil(textLength / wordsPerMinute);
       result = `(${value} min read)`;     
   }     
   return result;
}

supertester

@supertester

The Imprint supertester

Imprint Test Blog

Just a bunch of random stuff for testing.