Skip to content

Instantly share code, notes, and snippets.

@skysan87
Created May 30, 2019 00:34
Show Gist options
  • Save skysan87/747a95ee9c3cbbcba6b963192d2ddbeb to your computer and use it in GitHub Desktop.
Save skysan87/747a95ee9c3cbbcba6b963192d2ddbeb to your computer and use it in GitHub Desktop.
[C#]コンソールで進捗表示
class Program
{
static void Main(string[] args)
{
Console.WriteLine("start");
string output = "";
for (int i = 0; i < 5; i++)
{
System.Threading.Thread.Sleep(1000);
output += "=";
//\rは同じ行の行頭に戻るという意味がある
Console.Write("\r|{0}|", output.PadRight(5));
}
Console.WriteLine("");
Console.WriteLine("end");
Console.ReadKey();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment