You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
614 B

7 years ago
  1. package main
  2. import (
  3. "fmt"
  4. "strconv"
  5. "time"
  6. )
  7. func waitMinutes(minutes int) {
  8. //wait to avoid the twitter api limitation
  9. timeToSleep := time.Duration(minutes) * time.Minute
  10. fmt.Println("waiting " + strconv.Itoa(minutes) + " min to avoid twitter api limitation")
  11. fmt.Println(time.Now().Local())
  12. time.Sleep(timeToSleep)
  13. }
  14. func waitSeconds(seconds int) {
  15. //wait to avoid the twitter api limitation
  16. timeToSleep := time.Duration(seconds) * time.Second
  17. fmt.Println("waiting " + strconv.Itoa(seconds) + " seconds to avoid twitter api limitation")
  18. fmt.Println(time.Now().Local())
  19. time.Sleep(timeToSleep)
  20. }