SHARE
TWEET

Untitled

a guest Sep 14th, 2017 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/squirrelsh
  2.  
  3. class TestClass
  4. {
  5.     constructor(interger)
  6.     {
  7.         testint = interger;
  8.     }
  9.     testint = 0;
  10. }
  11.  
  12. function TestClass::Change(integer)
  13. {
  14.     testint = integer;
  15. }
  16.  
  17. function TestClass::DoPrint()
  18. {
  19.     print(testint.tostring() + " is the number!\n");
  20. }
  21.  
  22. local tc = TestClass(5);
  23. tc.DoPrint();
  24. tc.Change(10);
  25.  
  26. tc.DoPrint();
  27.  
  28. print("Speed Test\n");
  29.  
  30. local start = localtime();
  31. local loops = 10000000;
  32.  
  33. for(local i = 0.0; i < loops; i++)
  34.     sqrt(i);
  35.  
  36. local total = localtime() - start;
  37.  
  38. print(loops.tostring() + " sqrt function calls, starting at 0 ending at " + loops.tostring() + " in " + total.tostring() + " seconds\n");
RAW Paste Data
Top