Skip to content

Instantly share code, notes, and snippets.

@tsubakimoto
Created February 26, 2014 01:42
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 tsubakimoto/9221755 to your computer and use it in GitHub Desktop.
Save tsubakimoto/9221755 to your computer and use it in GitHub Desktop.

Snippets for Visual Studio

@tsubakimoto
Copy link
Author

dw.snippet

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
    xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Debug.WriteLine</Title>
            <Author>Yuta Matsumura</Author>
            <Description>Debug.WriteLine に対するコード スニペット</Description>
            <Shortcut>dw</Shortcut>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>value</ID>
                    <ToolTip>出力する値</ToolTip>
                    <Default>""</Default>
                </Literal>
            </Declarations>
            <Code Language="CSharp">
                <![CDATA[System.Diagnostics.Debug.WriteLine($value$);]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

@tsubakimoto
Copy link
Author

stopwatch.snippet

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
    xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Stopwatch</Title>
            <Author>Yuta Matsumura</Author>
            <Description>処理時間計測に関するコードスニペット</Description>
            <Shortcut>sw</Shortcut>
        </Header>
        <Snippet>
            <Code Language="CSharp"><![CDATA[var before = DateTime.Now.Ticks;

    var after = DateTime.Now.Ticks;
    System.Diagnostics.Debug.WriteLine(new TimeSpan(after - before).TotalMilliseconds);]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment