I need help on creating an algorithm that catches data on specific intervals as demonstrated in the picture.

These are incoming messages from MCU and split in C# to acquire information about sensor data.
A data package is as follows;

```
:;10;123.123

```

* `:` is message package initiator
* `10` is distance
* `123.123` is sensor reading

Message splitting happens with below code;

```
else if(s[0] == ':')
{
  string[] a = new String[3];
  string[] z = s.Split(';');

  for (int i = 0; i < z.Length; i++)
  {
    switch (i)
     {
       case 0:
           a[0] = z[i + 1];
           temp_distance = int.Parse(a[0]);
           break;
       case 1:
           a[1] = z[i+1];
           temp_dimension = float.Parse(a[1]);
           break;
      }
   }
}

```

A function needs to be called every specific interval as given in the picture.[![enter image description here](https://i.stack.imgur.com/IuI4I.jpg)](https://i.stack.imgur.com/IuI4I.jpg)

any help is appreciated.