I'm developing a plotting application which needs to plot a physiological signal at 300 Hz. I have elected to draw 12 data points every 40 mSec. using the 'FastLineSeries' of the 'Syncfusion' charting component.
If I use a timer method of the form:
Device.StartTimer(new TimeSpan(0, 0, 0, 0, PLOTFREQUENCY), () => { return PlotData();});
where:
PLOTFREQUENCY = 40 and
PlotData looks something like:
private bool PlotData()
{
plot 12 data points in here....
return true
}
It works perfectly.
However, if I use a construct of the form:
PlotDataAsync();
where:
PlotDataAsync looks something like:
private async void PlotDataAsync()
{
while (true)
{
await Task.Delay(PLOTFREQUENCY);
plot 12 data points in here....
}
}
The plotting is executed correctly, but much more slowly (at about half-speed).
I have only tested this on the Android platform (Nexus 10 and Samsung Note 3).
Can anyone suggest what might be happening?