quick game tick/client tiick update ?

Ok quick question: I have two methods that are called by my game loop: client tick which renders is called as often as possible, game tick which handles game logic is called at a set interval (30 gameticks per sec).

So mostly the process looks like the following:
client tick
client tick
client tick
game tick
client tick
client tick
client tick

but some times due to lag, I get the following:
client tick
game tick
game tick
game tick
client tick
client tick
client tick

The problem is that all of my update position code is in the game tick, so the position of a character will be updated several times without being rendered to the screen. The result is that the lag causes my charcater to skip across the screen. As far can understand, the game tick takes too long, resulting in calling of another game tick becasue of the timing. I realize that the update position code should not be in the game tick, so here is the question:

Where should I put my update position code? Not in the client tick since then it will happen too often. Should it stay in the game tick and some kind of loop has to be set up to check for lag?

How do you properly handle lag in your game loop?

Here is the code:

      passedTime = 0;
        previousTime = timer.getClockTicks();
        
        while (true) //run until quit app
            {
                  
                  
                  fTime = passedTime / TICKS_PER_GAMETICK;
                  
                  //rendering
                  clientTick();
            
                  currentTime = timer.getClockTicks();
                  passedTime +=  currentTime - previousTime; 
                  previousTime = currentTime;
                  
                  while( passedTime > TICKS_PER_GAMETICK )
                  {
                        
                        gameTick();
                        
                        passedTime -= TICKS_PER_GAMETICK;
                        
                  }
            
            }

Don’t separate them that way. If you have all your movement based on time, then do it this way:

get client input
get time that has passed
game logic(enemies, bonuses, etc…)
update positions
render

after looking over my code I have noticed that it is correct, with a render and interpolation happening every frame. And the average distance in pixels between 2 updates is 5 pixels.

I havce run numerous tests and the game still stutters all the time one machine, and never on another. What else can possibly cause the stutter? Could I be experiencing some kind of synching problem? I am using Java 1.5 and the GAGE Nano timer, but have had the same problem in 1.4.2 and the GAGE native timer.

I have noticed that the when the frame rate drops the stutter is more apparent