You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tune.go
    path of file: ./repos/podman/vendor/github.com/containers/luksy
    
    the code of the file until where you have to start completion: package luksy

import (
	"hash"
	"time"

	"golang.org/x/crypto/argon2"
	"golang.org/x/crypto/pbkdf2"
)

func durationOf(f func()) time.Duration {
	start := time.Now()
	f()
	return time.Since(start)
}

func IterationsPBKDF2(salt []byte, keyLen int, h func() hash.Hash) int {
	iterations := 2
	var d time.Duration
	for d < time.S
    
func IterationsPBKDF2(salt []byte, keyLen int, h func() hash.Hash) int {
	iterations := 2
	var d time.Duration
	for d < time.Second {
		d = durationOf(func() {
			_ = pbkdf2.Key([]byte{}, salt, iterations, keyLen, h)
		})
		if d < time.Second/10 {
			iterations *= 2
		} else {
			return iterations * int(time.Second) / int(d)
		}
	}
	return iterations
}