private void bgtest(Job j) { int words = 0; byte[] outdata = new byte[1024]; byte completediterations = 0; byte totaliterations = 60; WorkStatus ws; while(completediterations < totaliterations) { completediterations++; ws = new WorkStatus(j.jobhandle, completediterations, totaliterations); j.sendWorkUpdate(ws); Thread.Sleep(500); } words = 10; outdata = BitConverter.GetBytes(words); Console.WriteLine("Found {0} words", words); j.sendResults(outdata); //return outdata; }
private void randomlengthjob(Job j) { Random r = new Random(); int sleeptime = r.Next(1, 15); byte[] result = new byte[1]; result[0] = 1; Log.DebugFormat("Sleeping for {0} seconds", sleeptime); Thread.Sleep(sleeptime * 1000); j.sendResults(result); }
private static void randomlengthjob(Job j) { Random r = new Random(); int sleeptime = r.Next(1, 15); byte[] result = j.data; LoadTest.Log.DebugFormat("Sleeping for {0} seconds", sleeptime); Thread.Sleep(sleeptime * 1000); // Give back the same thing... j.sendResults(result); }
private static void wctest(Job j) { byte[] outdata = new byte[1024]; byte[] indata = j.data; Console.WriteLine("wc called"); int words = 0; for(int i = 0; i < indata.Length; i++) { if (indata[i] == 10) words++; } outdata = BitConverter.GetBytes(words); Console.WriteLine("Found {0} words", words); j.sendResults(outdata); }