22 Aug

Bootstrap Panel Samples

This example shows how to create a panel using bootstrap framework.

Firstly, you should add the following code to the head section in html:

  https://csharpexamples.com
  
  
  
  

Sample Usage :

    
Simple panel without heading
Sample 1
Panel Content 1
Sample 2
Panel Content 2
Sample 3
Panel Content 3
Sample 4
Panel Content 4
Sample 5
Panel Content 5
Sample 6
Panel Content 6

RESULT :
bootstrap panel samples

22 Aug

Bootstrap Pagination Samples

Pagination is the process of dividing the content into discrete pages, either electronic pages or printed pages. These examples show how to make pagination using bootstrap framework.

Firstly, you should add the following code to the head section in html:

  https://csharpexamples.com
  
  
  
  

SAMPLE USAGES :

Pagination with Disabled and Active States :

     

RESULT :
Bootstrap Pagination

Pager Sample :

    

RESULT :
Bootstrap pager

22 Aug

C# Calculate Execution Time

This example shows how much time takes a procedure/function/code. It is useful for micro-benchmarks in code optimization. To do this, We use the Stopwatch class in System.Diagnostics namespace.

Sample Code:

            // Create stopwatch
            Stopwatch stopwatch = new Stopwatch();

            // Begin timing
            stopwatch.Start();

            // Do something
            for (int i = 0; i < 10; i++)
            {
                Thread.Sleep(10);
            }

            // Stop timing
            stopwatch.Stop();

            // Write result
            Console.WriteLine("Total Time: {0}", stopwatch.ElapsedMilliseconds);