C# Simple if statement problem

I made a script to change the scene after some time has passed but it simply doesn’t work . i mean the code block after the if statement doesn’t get executed while the conditions of the statement are true . Here is the code :
`
using UnityEngine;
using System.Collections;

public class LogoScript : MonoBehaviour {

void Start () {

}

void Update () {
	Debug.Log(Time.realtimeSinceStartup);
	if(Time.realtimeSinceStartup>10)
	{
                    //the below code does not get executed
		Debug.Log("block executed");
		Application.LoadLevel("scene02");
	}
}

}
`

since Time.realtimeSinceStartup return float try:

if(Time.realtimeSinceStartup>10f)

also, what happen if you try:

if(Time.realtimeSinceStartup<10f)?

does the code run?

Hi George! I just copy-pasted your code into unity and the block does get executed, as a matter of fact I get an error because my project has no “scene 02”.

Dumb question: are you sure you saved this script and attached it to a game object in your hierarchy?
If so, then the problem must be elsewhere… that script is working though.

Note that realtimeSinceStartup returns
time as reported by system timer
In almost all cases you can and should use Time.time instead.

I would suggest using Time.timeSinceLevelLoad at least for debug.