Slowdown in JavaScript game on a laptop

Slowdown in JavaScript game on a laptop

I wrote a game in JavaScript/jQuery that uses a timer to update the character periodically. It works fine in a browser but when I run it in Ogre (via the Awesomium plug-in) there is a significant slow-down, although it still runs acceptably fast on my workstation. However, when run on a laptop with lower specs, it runs very slowly, it is not even playable.

Here is the relevant code:

      This is the main game file that starts the timer and calls the Update function of the main character:

  1. const TIMER_INTERVAL = 0.001;

  2. // Start the game
  3. var newBiology = new Game("newBiology", TIMER_INTERVAL);

  4. function Game(varName, interval)
  5. {
  6. this.update = function()
  7. {
  8. // Update the bee. 
  9. myBee.update(this.mUpdateInterval);
  10. }

  11. setInterval(varName + ".update()", TIMER_INTERVAL * 1000);
  12. this.mUpdateInterval = interval;
  13. }

And this is the main character's class:

  1. function Bee(node)
  2. {
  3.       this.Node = node;
  4.       
  5.       this.moveLeft = function()
  6. {
  7.    _x -= _speed;
  8.    _parent.css({ "left": _x + "px" });
  9. }

  10.       
  11.       this.moveRight = function()
  12. {
  13.    _x += _speed;
  14.    _parent.css({ "left": _x + "px" });
  15. }

  16.       
  17. this.update = function(timeSinceLastCall)
  18. {
  19.    if (_moveLeft)
  20.    {
  21.        this.moveLeft();
  22.    } // End if
  23.    else if (_moveRight)
  24.    {
  25.        this.moveRight();
  26.    } // End else if
  27.    else if (_moveDown)
  28.    {
  29.        this.moveDown();
  30.    } // End else if
  31.    else if (_moveUp)
  32.    {
  33.        this.moveUp();
  34.    } // End else if
  35. }

Anybody have any ideas why it would be so slow on a laptop with lower specs?