Does this function cause lag?

Hai!

Im making a game, where ur a character, and you walk on this planet(2d).

And when u walk, the planet and everything rotates around it, so the character actually never moves, just the enorivoment.

But I got this problem.

Even tho my main loop is made with a timer that uses only 5 milisec as wait time, it updates like approx half a second.

Its making it all look laggy.

Im woundering if it is lag or not.

Could this function be causeing the lag?

Code:

`public static BufferedImage rotateImg(BufferedImage bufferedImage,double radians){`

double radians2 = radians*Math.PI/180;

radians = (int)radians2;

AffineTransform tx = new AffineTransform();

//tx.scale(scalex, scaley);

//tx.shear(shiftx, shifty);

//tx.translate(x, y);

tx.rotate(radians2, bufferedImage.getWidth()/2, bufferedImage.getHeight()/2);

AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);

bufferedImage = op.filter(bufferedImage, null);

return bufferedImage;

}

Its a function that rotates a picture and return a new rotated picture.

When it all rotates, it uses this function for all images (2 so far) and it changes its position with a simple equation.

Does this make lag?