Advertisement
Guest User

Untitled

a guest
May 9th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public partial class Form1 : Form
  2. {
  3. Dictionary<int, Action> opcodes;
  4. Stopwatch watch = new Stopwatch();
  5. Action test = null;
  6.  
  7. public Form1()
  8. {
  9. InitializeComponent();
  10. opcodes = new Dictionary<int, Action>();
  11. CreateEntries();
  12. }
  13.  
  14. void CreateEntries()
  15. {
  16. for (int i = 0; i < 512; i++)
  17. opcodes.Add(i, NOP);
  18. }
  19.  
  20. void NOP()
  21. {
  22. }
  23.  
  24. private void Button1Clicked(object sender, EventArgs e)
  25. {
  26. watch.Start();
  27. test = opcodes[511];
  28. watch.Stop();
  29. MessageBox.Show("Time elapsed: " + watch.Elapsed);
  30. //test = null;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement