detects and executes function on window resize with 1 second delay