Skip to content

Ebiten on the server #3077

Answered by galsjel
wizzymore asked this question in Q&A
Discussion options

You must be logged in to vote

That's a lot of overhead to maintain an infinite for loop. Since it's server side and you don't want any window logic.

package main

import (
	"log"
	"time"
)

const target_tps = 50

func main() {
	ticker := time.NewTicker(time.Second / target_tps)
	for {
		<-ticker.C
		update()
	}
}

func update() {
	log.Println("update")
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by wizzymore
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants