Changing Block Producing Speed for votingDelay and votingPeriod

In the governance contract, https://docs.openzeppelin.com/contracts/4.x/governance, votingDelay and votingPeriod are set manually as number of blocks corresponding to the time of approximately one day or one week. However, in the future, the block producing speed may change after network updates. And an automatically set number based on average block producing speed can be more suitable in various voting scenarios.

Solidity can calculate the average block producing speed based on timestamps and block numbers. However, can it get the speed directly?

Emmm, maybe you can write some functions to change these variables, such as:

uint256 public votingDelay = 6575; // 1 day
function setVotingDelay() public pure override returns (uint256) {
    return votingDelay;
}

An admin of a contract sure can change the variable any time. But an admin-less (semi-) automatic repeating voting process is what is aimed for here. Timestamps could work but may not work well immediately after a network update.