Check player's position once per Second?

what would be the easiest way to check the player’s position once per second.

Vector3 PosPerSeconds()
	{
		posSeconds += Time.deltaTime;

		if (posSeconds >= posSecondsTimer)
		{
		  newCurrentPosition = player.transform.position;
		  posSeconds = 0;
		  print ("newCurrentPosition");
		}

		return newCurrentPosition;
	}

I set something up like this to return a position every three seconds. Does this look like it would work?

This will work, however a coroutine will be more efficient and have less overheads.

Edit: On second thoughts it might not be such a great idea. Calling a function every frame and getting a Vector3 returned each frame seems inefficient. Here’s how I would do it.

private Vector3 newCurrentPosition;

public Vector3 PosPerSeconds() {
    return newCurrentPosition;
}

void Awake () {
    StartCoroutine (UpdatePosition());
}

private IEnumerator UpdatePosition(){
    while (true) {
        newCurrentPosition = player.transform.position;
        yield return new WaitForSeconds(1);     
    }
}

Its also worth noting that this does not really make your code any better then getting the position directly off the player.transform every frame. I assume you have some reason in your logic to want a lagging position.

be lazy: (note may not be accurate code, change out what you need)
var playerpos : vetcor3

while(true){
    
    playerpos = transform.position //or whatever you want to do to get your player's position
    
    Debug.Log("Players Position: " + playerpos.x + "," + playerpos.y + "," + playerpos.z);
    yield waitforseconds(1.0);
}