Created
February 10, 2014 08:48
-
-
Save daanl/8912468 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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