Skip to content

Instantly share code, notes, and snippets.

@mayuki
Created May 12, 2010 09:06
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 mayuki/21ab0a6c1015f96f9c19 to your computer and use it in GitHub Desktop.
Save mayuki/21ab0a6c1015f96f9c19 to your computer and use it in GitHub Desktop.
% cat test3.cs
using System;
using System.IO;
using System.Threading;
using System.Collections.Generic;
public class Test {
private static Timer t1;
private static Timer t2;
private static Timer t3;
public static void Main () {
t1 = new Timer(Callback1, null, 0, 1000);
t2 = new Timer(Callback2, null, 0, 1000);
t3 = new Timer(Callback3, null, 0, 1000);
Console.ReadLine();
}
private static void Callback1(Object o) { Console.Write('1'); }
private static void Callback2(Object o) { Console.Write('2'); }
private static void Callback3(Object o) { Console.Write('3'); }
}
% ~/opt/mono-2.6.4/bin/gmcs test3.cs
test3.cs(7,26): warning CS0414: The private field `Test.t1' is assigned but its value is never used
test3.cs(8,26): warning CS0414: The private field `Test.t2' is assigned but its value is never used
test3.cs(9,26): warning CS0414: The private field `Test.t3' is assigned but its value is never used
Compilation succeeded - 3 warning(s)
% ~/opt/mono-2.4/bin/mono test3.exe
213321321321321321321321321321zsh: exit 58 ~/opt/mono-2.4/bin/mono test3.exe
% ~/opt/mono-2.6.4/bin/mono test3.exe
33333333333333333zsh: exit 58 ~/opt/mono-2.6.4/bin/mono test3.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment