Skip to content

Instantly share code, notes, and snippets.

@lanzafame
Last active January 22, 2016 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lanzafame/ca0e0f986384bbf6cb6d to your computer and use it in GitHub Desktop.
Save lanzafame/ca0e0f986384bbf6cb6d to your computer and use it in GitHub Desktop.
Java vs Golang AWS t2.micro
#!/bin/bash
for i in `seq 1 15`;
do
java8 -cp . Test // or in the go case: ./test
sleep 30
done
package main
import (
"fmt"
"time"
)
func main() {
list := []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}
for _, s := range list {
time.Sleep(40000 * time.Millisecond)
fmt.Println(s)
}
}
public class Test {
public static void main(String[] args) throws InterruptedException {
String numberList[] = {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
};
for (String s : numberList) {
Thread.sleep(40000);
System.out.println(s);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment