public void throttledShareScreenshots()
{
//Throttle the rate at which you can share screenshots
if (stopwatch.ElapsedMilliseconds - lastScreenshotShareTime > screenshotInterval)
{
lock (screenshotOutLock)
{
if (queuedOutScreenshot != null)
{
//Share the screenshot
sendShareScreenshotMesssage(queuedOutScreenshot);
queuedOutScreenshot = null;
lastScreenshotShareTime = stopwatch.ElapsedMilliseconds;
}
}
}
}