Home > Net >  Combox. Items. The Add (); Loop add up to 1 w but in 0.8 seconds
Combox. Items. The Add (); Loop add up to 1 w but in 0.8 seconds

Time:11-26


As shown, set up the cycle began to end time, calculated the whole process took 0.8 seconds, normal items. Add 1 w loop only about 0.0015 seconds is enough, could you tell me why so much difference?
This is a member of the class code in the linkerData set
 
Public class DataLinker: IComparable
{
String linker_name="contact 1";
String linker_ID="0000001";
Int call_type=1;
Int linker_about=0;
Int contact_index=0;
Public int Contact_Index
{
The get {return contact_index; }
The set {contact_index=value; }
}
Public void CLone (DataLinker link)
{
Contact_Index=link. Contact_Index;
Linker_about=link. Linker_about;
Linker_ID=link. Linker_ID;
Linker_name=link. Linker_name;
Call_type=link. Call_type;
}
Members of the # region IComparable
Public int CompareTo (object obj)
{
DataLinker p=obj as DataLinker;
If (p==null)
{
Throw new NotImplementedException ();
}
Return to this.contact_index.Com pareTo (p.c ontact_index);
}
# endregion
Public string Linker_name
{
The get
{
Return linker_name;
}
Set
{
Linker_name=value;
}
}
//,,, the rest is attribute encapsulation

CodePudding user response:

From the top, please give directions!!!!!!

CodePudding user response:

Date subtraction to calculate time, plus this is not you add is to add two once you see

CodePudding user response:

refer to the second floor rabbit family - second brother reply:
date subtraction to calculate time, coupled with this is not to add you, one is to add two times you didn't see

I this time is on the outside of the loop, and calculate the whole cycle unavailable, the end of the this value is calculated only once

CodePudding user response:

That both of you at the last page label you calculated in the time of the bits, you use the label displays the current time
  •  Tags:  
  • C#
  • Related