Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Basics Methods Methods

Atanu Mondal
Atanu Mondal
1,976 Points

Thread.Sleep() working without adding the namespace using System.Threading, why?

using System;
class Program { 
    static void Main(string[] args)
    {        
//Part2 using system Namespace
        Console.WriteLine("Welcome to cat store");
        Thread.Sleep(1000);
        Console.WriteLine("Done Sleeping");
    }

why the above code is working for me, i haven't used the namespace System.Threading; at the top.

BTW i am using visualStudio.

thanks for any explanation or any reference in advance.

1 Answer

Steven Parker
Steven Parker
217,602 Points

This is funny, most folks ask questions about why things are not working.   :laughing:

If you hover your mouse over the term, VS should pop up a helper message that shows you where the term is defined.