Пример #1
0
        public static void timer(__forTimer f, params string[] name)
        {
            assert(name.Length <= 1);

            Stopwatch watch = new Stopwatch();
            watch.Start();
            f();
            watch.Stop();
            float seconds = (watch.ElapsedMilliseconds / 1000.0f);

            if (name.Length > 0) print(name[0], ":", seconds);
            else print(seconds);
        }
Пример #2
0
        public static void timer(__forTimer f, params string[] name)
        {
            assert(name.Length <= 1);

            Stopwatch watch = new Stopwatch();

            watch.Start();
            f();
            watch.Stop();
            float seconds = (watch.ElapsedMilliseconds / 1000.0f);

            if (name.Length > 0)
            {
                print(name[0], ":", seconds);
            }
            else
            {
                print(seconds);
            }
        }