Use following code will cost about 40ms. How can I reduce to less than 1ms?
public bool SetPersAllRotTarget(RapidData data, string newValue,int index)
{
if (data != null)
{
try
{
//RobTarget type = (RobTarget)data.Value;
RobTarget type = new RobTarget();
type.FillFromString2(newValue);
data.WriteItem(type, index);
}
catch (ThreadAbortException tae)
{
}
catch (Exception ex)
{
if (abb.LogShow != null)
abb.LogShow(ex.Message);
MessageBox.Show(ex.Message, “错误”, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
return false;
}
return true;
}
else
return false;
}