That code wraps around various elements of your code that are initializing things. The Debug.Print statement will tell you how how long it took. You will see it in the output window of Visual studio when you debug your code.
Stopwatch dbTimer= Stopwatch.StartNew();
// do load database
dbTimer.Stop();
Debug.Writeline($"Loading Database, elapsed time: {dbTimer.ElapsedMilliseconds} ms.");
...
Stopwatch layerTimer= Stopwatch.StartNew();
// do Layer Creation
layerTimer.Stop();
Debug.Writeline($"Creating Layers, elapsed time: {layerTimer.ElapsedMilliseconds} ms.");
When this code gets called you might see something like this in the output window of your IDE while debugging:
Loading Database, elapsed time: 5042 ms.
Creating Layers, elapsed time: 15 ms.
That would tell you that the delay is loading the database, and you can decide how to change it, or where to put it.
I'm not familiar with the VB.NET IExtensionApplication.Initialize event is, but that's where you put code that runs when your app is loaded. If you were calling the loaddatabase in that function you'd see a pause when your app was first loaded into memory. If you were calling loaddatabase in some other command you created, you'd see the pause then.