Friday, October 19, 2012

code execution time tests c#

 Paste this into your C# code to test how long a portion of your code takes to execute. The number of milliseconds is appended to C:\TimeTest.txt


//**************************************
// Name: [ A Simple] code execution time tests
// Description:Paste this into your C# code to test how 
long a portion of your code takes to execute. 
The number of milliseconds is appended to C:\TimeTest.txt
// By: lonetron
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=1620&lngWId=10//for details.//**************************************

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace InCodeTimeTest{
 public class CInCodeTimeTest : System.Windows.Forms.Form{
  #region ConstructAndDispose
  private System.ComponentModel.Container components = null;
  public CInCodeTimeTest(){
   InitializeComponent();
  }
  protected override void Dispose( bool disposing )
  {
   if( disposing ){
    if (components != null) {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }
  #endregion
  #region Windows Form Designer generated code
  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>
  private void InitializeComponent()
  {
   // 
   // CInCodeTimeTest
   // 
   this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   this.ClientSize = new System.Drawing.Size(292, 273);
   this.Name = "CInCodeTimeTest";
   this.Text = "In Code Time Test";
   this.Load += new System.EventHandler(this.CInCodeTimeTest_Load);
  }
  #endregion
  #region Main
  [STAThread]
  static void Main() 
  {
   Application.Run(new CInCodeTimeTest());
  }
  #endregion Main
  private void CInCodeTimeTest_Load(object sender, System.EventArgs e)
  {
   /*
    --------------------------------
    Simple code execution time tests
    --------------------------------
    Paste this into your C# code to test how 
    long a portion of your code takes to execute. 
    The number of milliseconds is appended to C:\TimeTest.txt
   _________________________________________________________________________
    |This simple solution was brought to you by the P2B Consortium. |
    |�Create your very own artificial intelligence chat-bot now!�|
    |http://www.p2bconsortium.com/ |
    | |
    |Create, deploy and test artificial intelligence chat-bot |
    |now with Rapid Bot Trainer: http://www.p2bconsortium.com/sss/rbt.aspx |
    | |
    |Create, deploy and test artificial intelligence chat-bot |
    |now with ANY IRC CLIENT and no downloads:|
    |http://www.p2bconsortium.com/stork.html |
    | |
    |Create, test and deploy an artificial intelligence chat-bot|
    |to ANY ONLINE CHATROOM with the TANU public API web methods:|
    |http://www.p2bconsortium.com/Simple%20State%20Server%20Tutorial.htm|
    |http://www.p2bconsortium.com/sss/sss.asmx|
    |_________________________________________________________________________|
   */
   //Start Copying Here
   System.DateTime tm = System.DateTime.Now;
   //Stop Copying Here, Paste this before the code that you need to time test.
   System.Threading.Thread.Sleep(1000);
   //Start Copying Here
   System.DateTime tma = System.DateTime.Now;
   System.IO.StreamWriter sw = System.IO.File.AppendText("C:\\TimeTest.txt");
   sw.WriteLine((((((tma.Hour * (24 * 60 * 1000)) + (tma.Minute * (60 * 1000))) + (tma.Second * 1000)) + tma.Millisecond) - ((((tm.Hour * (24 * 60 * 1000)) + (tm.Minute * (60 * 1000))) + (tm.Second * 1000)) + tm.Millisecond)));
   sw.Flush();
   //Stop Copying Here
  }
 }
}
 
tags:
 c# programmer,classic asp developer,web forms,dot net developer,web app framework,c# web development,c# developers,web app builder,web application framework,asp development
asp dot net tutorial,download visual studio express,development net,asp programming
asp web developer,ajax controls,asp developer,web application generator,microsoft web development,web developer news,convert website to web application,microsoft official site
dot net development
  

No comments:

Post a Comment