RenderScript के टाइम फ़ंक्शन और टाइप
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
खास जानकारी
नीचे दिए गए फ़ंक्शन का इस्तेमाल, घड़ी का मौजूदा समय और सिस्टम के चालू रहने का मौजूदा समय बताने के लिए किया जा सकता है. हमारा सुझाव है कि इन फ़ंक्शन को कर्नेल में न कॉल करें.
खास जानकारी
प्रकार |
rs_time_t
|
1 जनवरी, 1970 से सेकंड
|
rs_tm
|
तारीख और समय का स्ट्रक्चर
|
प्रकार
rs_time_t
: 1 जनवरी, 1970 से सेकंड
32 बिट के लिए कंपाइल करते समय, int का typedef.
64 बिट के लिए कंपाइल करते समय, long का typedef.
Calendar time को, 1 जनवरी, 1970 को 00:00:00 कोऑर्डिनेटेड यूनिवर्सल टाइम (यूटीसी) से बीत चुके सेकंड के तौर पर समझा जाता है.
rs_tm
: तारीख और समय का स्ट्रक्चर
ऐसा स्ट्रक्चर जिसमें ये फ़ील्ड शामिल हों:
int tm_sec | मिनट के बाद सेकंड. यह वैल्यू 0 से 59 के बीच हो सकती है. हालांकि, लीप सेकंड के लिए यह 60 तक हो सकती है. |
int tm_min | घंटे के बाद के मिनट. यह वैल्यू 0 से 59 तक हो सकती है. |
int tm_hour | आधी रात के बाद के घंटे. यह वैल्यू 0 से 23 तक हो सकती है. |
int tm_mday | महीने का दिन. यह तारीख 1 से 31 के बीच की होनी चाहिए. |
int tm_mon | जनवरी से अब तक के महीने. यह 0 से 11 तक हो सकता है. |
int tm_year | साल 1900 के बाद के साल. |
int tm_wday | रविवार के बाद बीते दिन. यह 0 से 6 तक हो सकता है. |
int tm_yday | 1 जनवरी से अब तक के दिन. यह 0 से 365 तक हो सकता है. |
int tm_isdst | यह फ़्लैग बताता है कि डेलाइट सेविंग टाइम लागू है या नहीं. अगर यह लागू है, तो वैल्यू पॉज़िटिव होती है. अगर यह लागू नहीं है, तो वैल्यू शून्य होती है. अगर जानकारी उपलब्ध नहीं है, तो वैल्यू नेगेटिव होती है. |
अलग-अलग समय अवधियों के लिए डेटा स्ट्रक्चर.
फ़ंक्शन
rsGetDt
: पिछले कॉल के बाद से बीता समय
इस फ़ंक्शन को इस स्क्रिप्ट में आखिरी बार कॉल किए जाने के बाद सेकंड में बीता समय दिखाता है.
rsLocaltime
: स्थानीय समय में बदलना
पैरामीटर
स्थानीय | टाइम स्ट्रक्चर का पॉइंटर, जहां स्थानीय समय सेव किया जाएगा. |
टाइमर | समय को 1 जनवरी, 1970 से सेकंड के तौर पर डालें. |
रिटर्न
आउटपुट के स्थानीय समय का पॉइंटर. इसका मतलब है कि यह वैल्यू, local पैरामीटर की वैल्यू जैसी ही होती है. |
टाइमर से तय किए गए समय को rs_tm स्ट्रक्चर में बदलता है. इस स्ट्रक्चर में साल, महीना, घंटा वगैरह की जानकारी होती है. यह वैल्यू *local में सेव होती है.
यह फ़ंक्शन वही पॉइंटर दिखाता है जो पहले आर्ग्युमेंट के तौर पर पास किया गया था. अगर local पैरामीटर की वैल्यू NULL है, तो यह फ़ंक्शन कुछ नहीं करता और NULL दिखाता है.
rsTime
: 1 जनवरी, 1970 से सेकंड
पैरामीटर
टाइमर | कैलेंडर से मिला समय सेव करने के लिए जगह. |
रिटर्न
Epoch के बाद के सेकंड. अगर कोई गड़बड़ी है, तो -1. |
यह फ़ंक्शन, 1 जनवरी, 1970 को 00:00:00 यूटीसी से अब तक बीते सेकंड की संख्या दिखाता है.
अगर टाइमर नॉल-नॉल नहीं है, तो नतीजा उस मेमोरी में भी सेव किया जाता है जिस पर यह वैरिएबल ले जाता है.
rsUptimeMillis
: सिस्टम के चालू रहने का कुल समय मिलीसेकंड में
मिलीसेकंड में, सिस्टम की मौजूदा घड़ी (अपटाइम) दिखाता है.
rsUptimeNanos
: सिस्टम के चालू रहने का कुल समय नैनोसेकंड में
सिस्टम क्लॉक (अपटाइम) की मौजूदा वैल्यू को नैनोसेकंड में दिखाता है.
इस कॉल से मिली वैल्यू की बारीकी, एक नैनोसेकंड से काफ़ी ज़्यादा हो सकती है.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# RenderScript Time Functions and Types\n\nOverview\n--------\n\nThe functions below can be used to tell the current clock time and the current\nsystem up time. It is not recommended to call these functions inside of a kernel.\n\nSummary\n-------\n\n| Types ||\n|--------------------------------------------------------------------------------|-------------------------------|\n| [rs_time_t](/guide/topics/renderscript/reference/rs_time#android_rs:rs_time_t) | Seconds since January 1, 1970 |\n| [rs_tm](/guide/topics/renderscript/reference/rs_time#android_rs:rs_tm) | Date and time structure |\n\n| Functions ||\n|------------------------------------------------------------------------------------------|-------------------------------|\n| [rsGetDt](/guide/topics/renderscript/reference/rs_time#android_rs:rsGetDt) | Elapsed time since last call |\n| [rsLocaltime](/guide/topics/renderscript/reference/rs_time#android_rs:rsLocaltime) | Convert to local time |\n| [rsTime](/guide/topics/renderscript/reference/rs_time#android_rs:rsTime) | Seconds since January 1, 1970 |\n| [rsUptimeMillis](/guide/topics/renderscript/reference/rs_time#android_rs:rsUptimeMillis) | System uptime in milliseconds |\n| [rsUptimeNanos](/guide/topics/renderscript/reference/rs_time#android_rs:rsUptimeNanos) | System uptime in nanoseconds |\n\nTypes\n-----\n\n#### rs_time_t\n: Seconds since January 1, 1970\n\nA typedef of: int When compiling for 32 bits.\n\nA typedef of: long When compiling for 64 bits.\n\nCalendar time interpreted as seconds elapsed since the Epoch (00:00:00 on\nJanuary 1, 1970, Coordinated Universal Time (UTC)). \n\n#### rs_tm\n: Date and time structure\n\nA structure with the following fields:\n\n| int tm_sec | Seconds after the minute. This ranges from 0 to 59, but possibly up to 60 for leap seconds. |\n| int tm_min | Minutes after the hour. This ranges from 0 to 59. |\n| int tm_hour | Hours past midnight. This ranges from 0 to 23. |\n| int tm_mday | Day of the month. This ranges from 1 to 31. |\n| int tm_mon | Months since January. This ranges from 0 to 11. |\n| int tm_year | Years since 1900. |\n| int tm_wday | Days since Sunday. This ranges from 0 to 6. |\n| int tm_yday | Days since January 1. This ranges from 0 to 365. |\n| int tm_isdst | Flag to indicate whether daylight saving time is in effect. The value is positive if it is in effect, zero if it is not, and negative if the information is not available. |\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n\u003cbr /\u003e\n\nData structure for broken-down time components.\n\nFunctions\n---------\n\n#### rsGetDt\n: Elapsed time since last call\n\n|------------------|---|\n| float rsGetDt(); | |\n\n##### Returns\n\n|------------------|\n| Time in seconds. |\n\nReturns the time in seconds since this function was last called in this script. \n\n#### rsLocaltime\n: Convert to local time\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [rs_tm](/guide/topics/renderscript/reference/rs_time#android_rs:rs_tm)\\* rsLocaltime([rs_tm](/guide/topics/renderscript/reference/rs_time#android_rs:rs_tm)\\* local, const [rs_time_t](/guide/topics/renderscript/reference/rs_time#android_rs:rs_time_t)\\* timer); | |\n\n##### Parameters\n\n| local | Pointer to time structure where the local time will be stored. |\n| timer | Input time as a number of seconds since January 1, 1970. |\n|-------|----------------------------------------------------------------|\n\n##### Returns\n\n|-------------------------------------------------------------------------------|\n| Pointer to the output local time, i.e. the same value as the parameter local. |\n\nConverts the time specified by timer into a [rs_tm](/guide/topics/renderscript/reference/rs_time#android_rs:rs_tm) structure that provides year, month,\nhour, etc. This value is stored at \\*local.\n\nThis functions returns the same pointer that is passed as first argument. If the\nlocal parameter is NULL, this function does nothing and returns NULL. \n\n#### rsTime\n: Seconds since January 1, 1970\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [rs_time_t](/guide/topics/renderscript/reference/rs_time#android_rs:rs_time_t) rsTime([rs_time_t](/guide/topics/renderscript/reference/rs_time#android_rs:rs_time_t)\\* timer); | |\n\n##### Parameters\n\n| timer | Location to also store the returned calendar time. |\n|-------|----------------------------------------------------|\n\n##### Returns\n\n|--------------------------------------------------|\n| Seconds since the Epoch, -1 if there's an error. |\n\nReturns the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970).\n\nIf timer is non-NULL, the result is also stored in the memory pointed to by\nthis variable. \n\n#### rsUptimeMillis\n: System uptime in milliseconds\n\n|-----------------------------------------------------------------------------------------------------|---|\n| [int64_t](/guide/topics/renderscript/reference/rs_value_types#android_rs:int64_t) rsUptimeMillis(); | |\n\n##### Returns\n\n|-------------------------|\n| Uptime in milliseconds. |\n\nReturns the current system clock (uptime) in milliseconds. \n\n#### rsUptimeNanos\n: System uptime in nanoseconds\n\n|----------------------------------------------------------------------------------------------------|---|\n| [int64_t](/guide/topics/renderscript/reference/rs_value_types#android_rs:int64_t) rsUptimeNanos(); | |\n\n##### Returns\n\n|------------------------|\n| Uptime in nanoseconds. |\n\nReturns the current system clock (uptime) in nanoseconds.\n\nThe granularity of the values return by this call may be much larger than a nanosecond."]]