Exemplo n.º 1
0
        private void Go_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in m_Data.Rows)
            {
                string name          = row.Cells[TestName.Name].Value.ToString();
                int    numberOfTests = int.Parse(row.Cells[Tests.Name].Value.ToString());
                bool   enabled       = (bool)row.Cells[RunTest.Name].Value;

                if (enabled == true)
                {
                    long timeStart = DateTime.Now.Ticks;

                    ProfileTest test = TestManager.Tests[name];

                    test(numberOfTests);

                    long timeEnd = DateTime.Now.Ticks;

                    double diff = (double)timeEnd - (double)timeStart;

                    double av = diff / (double)numberOfTests;

                    row.Cells[Average.Name].Value = (av / TimeSpan.TicksPerMillisecond).ToString("N6");
                    row.Cells[Total.Name].Value   = (diff / TimeSpan.TicksPerMillisecond).ToString("N6");
                }
                else
                {
                    row.Cells[Average.Name].Value = "--";
                    row.Cells[Total.Name].Value   = "--";
                }
            }
        }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        // Deve ser chamado na primeira cena
        IOUserProfile.Init ();

        // Recebe a lista de perfis
        string[] profiles = IOUserProfile.GetProfiles ();

        // Adiciona os perfis em uma lista
        for (int i = 0; i < profiles.Length; i++) {
            GameObject tempProfEntry = GameObject.Instantiate(ProfileEntry) as GameObject;
            MainMenuUIProfiles profData = tempProfEntry.GetComponent<MainMenuUIProfiles>();
            profData.ProfileName.text = profiles[i];

            tempProfEntry.transform.SetParent(ProfileList);
        }
    }
Exemplo n.º 3
0
            public async Task <Result> CreateNewTest(Contract request, CancellationToken token)
            {
                var newTest = ProfileTest.Create(
                    request.Title,
                    new List <ObjectId>(),
                    request.IsDefault
                    ).Data;

                await _db.ProfileTestCollection.InsertOneAsync(
                    newTest, cancellationToken : token
                    );

                request.Id = newTest.Id.ToString();

                newTest.Questions = await UpdateQuestions(request, token);

                await _db.ProfileTestCollection.ReplaceOneAsync(
                    t => t.Id == newTest.Id, newTest,
                    cancellationToken : token
                    );

                return(Result.Ok(request));
            }