小编jus*_*cks的帖子

测量Xcode/Iphone中的FPS /性能

我正在运行Sencha Touch应用程序,我想知道在Xcode的设备上运行我的应用程序时测量我的FPS的最佳方法是什么?具体来说,我有一个无限滚动的Facebook般的墙,我正在尝试衡量我的滚动性能.

iphone performance xcode extjs

17
推荐指数
1
解决办法
1万
查看次数

使用decodeURI与cookie javascript

我的问题是我需要一个变量来跟踪我的所有cookie,这样我就可以将该变量中的字符串拆分成一个数组,然后从那里解析字符串.我想知道为什么简单的以下代码不适合我?

var count = 0;          //keeps track of how many times this page has been visited
var lastVisit = new Date();     //records the last visit date in UTC format (or extra-challenge: in a user-friendly format like "Tuesday 10/12/2013 at 9:34:50")
var exDate  = new Date(lastVisit.getTime() + 30000);
var savedData = decodeURI(document.cookie);  //contains cookie contents

document.cookie = encodeURI("count=" + count.toString() + "; expires=" + exDate.toUTCString());
Run Code Online (Sandbox Code Playgroud)

我需要发生的是每当我设置一个cookie以将其添加到savedData变量时,我无法弄清楚为什么没有发生这种情况.谢谢

javascript cookies

5
推荐指数
1
解决办法
5531
查看次数

将Array作为参数传递给C中的新线程

我试图使用pthread_create将数组作为参数传递给新线程中的函数,这可能吗?我有一个整数数组和一个从创建线程方法调用的计算平均方法,但我似乎无法正确地将我的数组传递给方法.这是我的代码:int nums [];

int average;

int size = 0;


void *calcAvg(int *nums[]);

int main(int argc, char *argv[]){
    /* initialize an array of the integers to be passed */
    nums[argc - 1];
    for(int i = 0; i < argc - 1; i++){
        nums[i] = atoi(argv[i + 1]);
        size++;
    }

    /* Thread Identifier */
    pthread_t avgThread;

    pthread_create(&avgThread, NULL, calcAvg, nums);

    pthread_join(avgThread, NULL);

    printf("average= %d", average);
}

void *calcAvg(int *nums[]){
    int sum;
    for(int i = 0; i < size; i++){
        sum += nums[i]; …
Run Code Online (Sandbox Code Playgroud)

c arrays multithreading

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

arrays ×1

c ×1

cookies ×1

extjs ×1

iphone ×1

javascript ×1

multithreading ×1

performance ×1

xcode ×1