Quitado los cronometros para mejorar la performance

This commit is contained in:
Miguel 2025-02-17 13:03:43 +01:00
parent 72256a214c
commit 210b93b15a
1 changed files with 0 additions and 21 deletions

View File

@ -50,9 +50,6 @@ namespace LibS7Adv
[JsonIgnore]
private IInstance Instance { get; set; }
[JsonIgnore]
private Stopwatch stopwatch = new Stopwatch();
private bool IsConfigured { get; set; }
[ObservableProperty]
@ -335,10 +332,7 @@ namespace LibS7Adv
{
try
{
stopwatch.Restart();
Instance?.WriteBool(pTag, pValue);
stopwatch.Stop();
Debug.WriteLine($" EscribirTagBool took {stopwatch.Elapsed.TotalMilliseconds} ms");
}
catch (Exception ex)
{
@ -349,10 +343,7 @@ namespace LibS7Adv
{
try
{
stopwatch.Restart();
Instance?.WriteInt16(pTag, (short)pValue);
stopwatch.Stop();
Debug.WriteLine($" EscribirTagInt16 took {stopwatch.Elapsed.TotalMilliseconds} ms");
}
catch (Exception ex)
{
@ -364,10 +355,7 @@ namespace LibS7Adv
{
try
{
stopwatch.Restart();
bool result = Instance?.ReadBool(pTag) ?? false;
stopwatch.Stop();
Debug.WriteLine($" LeerTagBool took {stopwatch.Elapsed.TotalMilliseconds} ms");
return result;
}
catch (Exception ex)
@ -381,10 +369,7 @@ namespace LibS7Adv
{
try
{
stopwatch.Restart();
int? result = Instance?.ReadInt16(pTag);
stopwatch.Stop();
Debug.WriteLine($" LeerTagInt16 took {stopwatch.Elapsed.TotalMilliseconds} ms");
return result;
}
catch (Exception ex)
@ -398,10 +383,7 @@ namespace LibS7Adv
{
try
{
stopwatch.Restart();
int? result = Instance?.ReadInt32(pTag);
stopwatch.Stop();
Debug.WriteLine($" LeerTagDInt took {stopwatch.Elapsed.TotalMilliseconds} ms");
return result;
}
catch (Exception ex)
@ -415,10 +397,7 @@ namespace LibS7Adv
{
try
{
stopwatch.Restart();
Instance?.WriteInt32(pTag, pValue);
stopwatch.Stop();
Debug.WriteLine($" EscribirTagDInt took {stopwatch.Elapsed.TotalMilliseconds} ms");
}
catch (Exception ex)
{