Skip to content

Instantly share code, notes, and snippets.

@daanl
Created February 10, 2014 08:48
Show Gist options
  • Save daanl/8912468 to your computer and use it in GitHub Desktop.
Save daanl/8912468 to your computer and use it in GitHub Desktop.
public ActionResult SentMultipleBackgroundMessage()
{
var amount = 50000;
var stopwatch = new Stopwatch();
stopwatch.Start();
foreach (var index in Enumerable.Range(0, amount))
{
MvcApplication.ServiceBus.Publish(new StartMultipleBackgroundWorkMessage
{
Index = index
});
}
stopwatch.Stop();
var result = string.Format("Done after: {0} messages amount: {1}", stopwatch.Elapsed, amount);
return RedirectToAction("Index");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment