Is it expected that my script runs this slow?

Is it expected that my script runs this slow?

I have added a small script to a wordpress site, being developed locally inside a LAMP-stack.
It's just a few lines, the entire file is what you see below. From when the html+css is drawn in the browser (current FF and Chrome) it takes about ½ second until I see the new script-inserted margin-bottom having its effect.

I thought this small change would be applied without the eye noticing it.

Is it normal that it takes such a long time?

  1. var setThumbMargin = function () {
  2.     var calendarItemMargin = jQuery('.calendar-item:nth-of-type(2)').css('margin-left');
  3.     jQuery('.calendar-item').css("margin-bottom", calendarItemMargin);
  4. };
  5. jQuery(document).ready(function () {
  6.     setThumbMargin();
  7. });
  8. jQuery(window).resize(function () {
  9.     setThumbMargin();
  10. });